summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJacob Walls <jacobtylerwalls@gmail.com>2021-07-22 07:45:53 (GMT)
committerGitHub <noreply@github.com>2021-07-22 07:45:53 (GMT)
commitc0f2fcf9bb033486c7a011e5f4139aca0a1eac67 (patch)
tree3dbf0b3090a43f40b4408d3f835f0d4f9e317501
parent92a5c0871bfd835496ce5635f08d2bf0c62cb42a (diff)
downloadcpython-c0f2fcf9bb033486c7a011e5f4139aca0a1eac67.zip
cpython-c0f2fcf9bb033486c7a011e5f4139aca0a1eac67.tar.gz
cpython-c0f2fcf9bb033486c7a011e5f4139aca0a1eac67.tar.bz2
Speed up test_urlsplit_normalization (GH-26688)
-rw-r--r--Lib/test/test_urlparse.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/test/test_urlparse.py b/Lib/test/test_urlparse.py
index dff9a8e..2f629c7 100644
--- a/Lib/test/test_urlparse.py
+++ b/Lib/test/test_urlparse.py
@@ -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