diff options
author | Hasan Ramezani <hasan.r67@gmail.com> | 2019-10-28 11:40:09 +0100 |
---|---|---|
committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2019-10-29 09:14:24 +0100 |
commit | 39a34d4bf94bc8325119bc23b64f3a041a85dd2d (patch) | |
tree | 097d5b965df8bf4ace58fd6b5d5f85e3de63cc4c /django/utils/regex_helper.py | |
parent | c4cba148d8356596da80c4d93a96fb335e4b0b6b (diff) | |
download | django-39a34d4bf94bc8325119bc23b64f3a041a85dd2d.tar.gz |
Refs #30899 -- Made _lazy_re_compile() support bytes.
Diffstat (limited to 'django/utils/regex_helper.py')
-rw-r--r-- | django/utils/regex_helper.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/django/utils/regex_helper.py b/django/utils/regex_helper.py index e910cac4aa..8612475b96 100644 --- a/django/utils/regex_helper.py +++ b/django/utils/regex_helper.py @@ -341,7 +341,7 @@ def _lazy_re_compile(regex, flags=0): """Lazily compile a regex with flags.""" def _compile(): # Compile the regex if it was not passed pre-compiled. - if isinstance(regex, str): + if isinstance(regex, (str, bytes)): return re.compile(regex, flags) else: assert not flags, ( |