Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

elliotwutingfeng
Copy link
Contributor

Proposed change

I found some portions of alabel() which are either unreachable or redundant.


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

is not reachable because an empty string would be caught by ulabel(label_bytes) in the preceding try-block.


label = str(label)

is redundant as label is already a str, if it was not a str it would have been caught by the preceding try-block.


We can simplify label_bytes as _alabel_prefix + _punycode(label).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants