diff options
Diffstat (limited to 'Lib/encodings/idna.py')
-rw-r--r-- | Lib/encodings/idna.py | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/Lib/encodings/idna.py b/Lib/encodings/idna.py index c2ba1da..583bdf1 100644 --- a/Lib/encodings/idna.py +++ b/Lib/encodings/idna.py @@ -176,12 +176,10 @@ class Codec(codecs.Codec): return "", 0 # IDNA allows decoding to operate on Unicode strings, too. - if isinstance(input, bytes): - labels = dots.split(input) - else: - # Force to bytes + if not isinstance(input, bytes): + # XXX obviously wrong, see #3232 input = bytes(input) - labels = input.split(b".") + labels = input.split(b".") if labels and len(labels[-1]) == 0: trailing_dot = '.' |