Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove redundant steps in alabel() #152

Merged
merged 4 commits into from
Apr 2, 2024
Merged

Remove redundant steps in alabel() #152

merged 4 commits into from
Apr 2, 2024

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).

@kjd kjd merged commit cd58a23 into kjd:master Apr 2, 2024
14 checks passed
@elliotwutingfeng elliotwutingfeng deleted the dev branch April 2, 2024 15:01
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