mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
Replace uses of map()
In Python 2, map() returns a list; in Python 3 it returns an iterator. Replace all uses by list comprehensions, generators, or for loops, as required. Reviewed-By: Christian Heimes <cheimes@redhat.com> Reviewed-By: Jan Cholasta <jcholast@redhat.com>
This commit is contained in:
committed by
Jan Cholasta
parent
fbacc26a6a
commit
ace63f4ea5
@@ -234,7 +234,8 @@ def validate_domain_name(domain_name, allow_underscore=False, allow_slash=False)
|
||||
domain_name = domain_name.split(".")
|
||||
|
||||
# apply DNS name validator to every name part
|
||||
map(lambda label:validate_dns_label(label, allow_underscore, allow_slash), domain_name)
|
||||
for label in domain_name:
|
||||
validate_dns_label(label, allow_underscore, allow_slash)
|
||||
|
||||
|
||||
def validate_zonemgr(zonemgr):
|
||||
@@ -734,7 +735,8 @@ def validate_idna_domain(value):
|
||||
#user should use normalized names to avoid mistakes
|
||||
labels = re.split(u'[.\uff0e\u3002\uff61]', value, flags=re.UNICODE)
|
||||
try:
|
||||
map(lambda label: label.encode("ascii"), labels)
|
||||
for label in labels:
|
||||
label.encode("ascii")
|
||||
except UnicodeError:
|
||||
# IDNA
|
||||
is_nonnorm = any(encodings.idna.nameprep(x) != x for x in labels)
|
||||
|
||||
Reference in New Issue
Block a user