Kaydet (Commit) a40cf31d authored tarafından Walter Dörwald's avatar Walter Dörwald

Make error message less misleading for u"a..b".encode("idna").

üst 82972e7f
......@@ -70,7 +70,7 @@ def ToASCII(label):
# Skip to step 8.
if 0 < len(label) < 64:
return label
raise UnicodeError("label too long")
raise UnicodeError("label empty or too long")
# Step 2: nameprep
label = nameprep(label)
......@@ -85,7 +85,7 @@ def ToASCII(label):
# Skip to step 8.
if 0 < len(label) < 64:
return label
raise UnicodeError("label too long")
raise UnicodeError("label empty or too long")
# Step 5: Check ACE prefix
if label.startswith(uace_prefix):
......@@ -100,7 +100,7 @@ def ToASCII(label):
# Step 8: Check size
if 0 < len(label) < 64:
return label
raise UnicodeError("label too long")
raise UnicodeError("label empty or too long")
def ToUnicode(label):
# Step 1: Check for ASCII
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment