Skip to content

Commit

Permalink
modifyModlist(): avoid map(None, ...)
Browse files Browse the repository at this point in the history
  • Loading branch information
stroeder authored and Petr Viktorin committed Nov 22, 2017
1 parent 8bded9c commit 6615bb1
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Lib/ldap/modlist.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,11 @@ def modifyModlist(
if not replace_attr_value:
if attrtype_lower in case_ignore_attr_types:
norm_func = str.lower
old_value_set = set(map(str.lower,old_value))
new_value_set = set(map(str.lower,new_value))
else:
norm_func = None
old_value_set=set(map(norm_func,old_value))
new_value_set=set(map(norm_func,new_value))
old_value_set = set(old_value)
new_value_set = set(new_value)
replace_attr_value = new_value_set != old_value_set
if replace_attr_value:
modlist.append((ldap.MOD_DELETE,attrtype,None))
Expand Down

0 comments on commit 6615bb1

Please sign in to comment.