Skip to content

Commit

Permalink
Remove redundant encode
Browse files Browse the repository at this point in the history
Unclear why this was originally introduced, in 00a919e. The commit mentions Python 3.3 specifically. That version is long EOL. Now, the test suite still passes after removing the encode.
  • Loading branch information
john-kurkowski committed Mar 4, 2022
1 parent 226bfc2 commit 6e2c0e0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tldextract/tldextract.py
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ def _decode_punycode(label: str) -> str:
looks_like_puny = lowered.startswith("xn--")
if looks_like_puny:
try:
return idna.decode(lowered.encode("ascii"))
return idna.decode(lowered)
except (UnicodeError, IndexError):
pass
return lowered

0 comments on commit 6e2c0e0

Please sign in to comment.