[Python-checkins] Speed up test_urlsplit_normalization (GH-26688)

serhiy-storchaka webhook-mailer at python.org
Thu Jul 22 03:46:03 EDT 2021


https://github.com/python/cpython/commit/c0f2fcf9bb033486c7a011e5f4139aca0a1eac67
commit: c0f2fcf9bb033486c7a011e5f4139aca0a1eac67
branch: main
author: Jacob Walls <jacobtylerwalls at gmail.com>
committer: serhiy-storchaka <storchaka at gmail.com>
date: 2021-07-22T10:45:53+03:00
summary:

Speed up test_urlsplit_normalization (GH-26688)

files:
M Lib/test/test_urlparse.py

diff --git a/Lib/test/test_urlparse.py b/Lib/test/test_urlparse.py
index dff9a8ede9b60..2f629c72ae784 100644
--- a/Lib/test/test_urlparse.py
+++ b/Lib/test/test_urlparse.py
@@ -1079,7 +1079,8 @@ def test_urlsplit_normalization(self):
         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



More information about the Python-checkins mailing list