Skip to content

Commit

Permalink
Merge pull request #152 from elliotwutingfeng/dev
Browse files Browse the repository at this point in the history
Remove redundant steps in alabel()
  • Loading branch information
kjd authored Apr 2, 2024
2 parents 1b12148 + c095c75 commit cd58a23
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions idna/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,13 +262,8 @@ def alabel(label: str) -> bytes:
except UnicodeEncodeError:
pass

if not label:
raise IDNAError('No Input')

label = str(label)
check_label(label)
label_bytes = _punycode(label)
label_bytes = _alabel_prefix + label_bytes
label_bytes = _alabel_prefix + _punycode(label)

if not valid_label_length(label_bytes):
raise IDNAError('Label too long')
Expand Down

0 comments on commit cd58a23

Please sign in to comment.