mirror of
https://github.com/django/django.git
synced 2025-09-26 20:19:16 +00:00
Refs #30899 -- Made _lazy_re_compile() support bytes.
This commit is contained in:
parent
c4cba148d8
commit
39a34d4bf9
1 changed files with 1 additions and 1 deletions
|
@ -341,7 +341,7 @@ def _lazy_re_compile(regex, flags=0):
|
||||||
"""Lazily compile a regex with flags."""
|
"""Lazily compile a regex with flags."""
|
||||||
def _compile():
|
def _compile():
|
||||||
# Compile the regex if it was not passed pre-compiled.
|
# Compile the regex if it was not passed pre-compiled.
|
||||||
if isinstance(regex, str):
|
if isinstance(regex, (str, bytes)):
|
||||||
return re.compile(regex, flags)
|
return re.compile(regex, flags)
|
||||||
else:
|
else:
|
||||||
assert not flags, (
|
assert not flags, (
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue