From 20a7de645f0a3cc7c30b0d9d1c19bdaa4237c489 Mon Sep 17 00:00:00 2001 From: Jacob Walls Date: Sat, 12 Jun 2021 01:36:39 -0400 Subject: [PATCH] Speed up test_urlsplit_normalization --- Lib/test/test_urlparse.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Lib/test/test_urlparse.py b/Lib/test/test_urlparse.py index dff9a8ede9b601..2f629c72ae784e 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