From 068f48f2ad1761034804879ad32c91e6b52a2e31 Mon Sep 17 00:00:00 2001 From: Wu Tingfeng Date: Thu, 23 Nov 2023 07:20:34 +0800 Subject: [PATCH] Remove redundant steps --- idna/core.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/idna/core.py b/idna/core.py index 0bd89a3..9eecaf3 100644 --- a/idna/core.py +++ b/idna/core.py @@ -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')