Speed up test_urlsplit_normalization (GH-26688)

This commit is contained in:
Jacob Walls 2021-07-22 03:45:53 -04:00 committed by GitHub
parent 92a5c0871b
commit c0f2fcf9bb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -1079,7 +1079,8 @@ class UrlParseTestCase(unittest.TestCase):
hex_chars = {'{:04X}'.format(ord(c)) for c in illegal_chars}
denorm_chars = [
c for c in map(chr, range(128, sys.maxunicode))
if (hex_chars & set(unicodedata.decomposition(c).split()))
if unicodedata.decomposition(c)
and (hex_chars & set(unicodedata.decomposition(c).split()))
and c not in illegal_chars
]
# Sanity check that we found at least one such character