summaryrefslogtreecommitdiff
path: root/django/test/html.py
diff options
context:
space:
mode:
authorHasan Ramezani <hasan.r67@gmail.com>2019-10-26 16:42:32 +0200
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2019-10-29 09:22:26 +0100
commite3d0b4d5501c6d0bc39f035e4345e5bdfde12e41 (patch)
treea8ddbafdf4a38a87df6f65fc4d02dba08c725096 /django/test/html.py
parent39a34d4bf94bc8325119bc23b64f3a041a85dd2d (diff)
Fixed #30899 -- Lazily compiled import time regular expressions.
Diffstat (limited to 'django/test/html.py')
-rw-r--r--django/test/html.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/django/test/html.py b/django/test/html.py
index 511c08bb26..36b44b0466 100644
--- a/django/test/html.py
+++ b/django/test/html.py
@@ -1,12 +1,13 @@
"""Compare two HTML documents."""
-import re
from html.parser import HTMLParser
+from django.utils.regex_helper import _lazy_re_compile
+
# ASCII whitespace is U+0009 TAB, U+000A LF, U+000C FF, U+000D CR, or U+0020
# SPACE.
# https://infra.spec.whatwg.org/#ascii-whitespace
-ASCII_WHITESPACE = re.compile(r'[\t\n\f\r ]+')
+ASCII_WHITESPACE = _lazy_re_compile(r'[\t\n\f\r ]+')
def normalize_whitespace(string):