Skip to content

Commit 592a74b

Browse files
author
stroeder
committed
modifyModlist(): avoid map(None, ...)
1 parent 5c11c36 commit 592a74b

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

Lib/ldap/modlist.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,11 @@ def modifyModlist(
7474
if not replace_attr_value:
7575
if attrtype_lower in case_ignore_attr_types:
7676
norm_func = str.lower
77+
old_value_set = set(map(str.lower,old_value))
78+
new_value_set = set(map(str.lower,new_value))
7779
else:
78-
norm_func = None
79-
old_value_set=set(map(norm_func,old_value))
80-
new_value_set=set(map(norm_func,new_value))
80+
old_value_set = set(old_value)
81+
new_value_set = set(new_value)
8182
replace_attr_value = new_value_set != old_value_set
8283
if replace_attr_value:
8384
modlist.append((ldap.MOD_DELETE,attrtype,None))

0 commit comments

Comments
 (0)