diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2008-08-19 17:56:33 (GMT) |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2008-08-19 17:56:33 (GMT) |
commit | fd036451bf0e0ade8783e21df801abf7be96d020 (patch) | |
tree | e70ff65a9e641d8e790bc091f0dc2507baf344ca /Lib/_strptime.py | |
parent | 3ad7ba10a20827b24d4b1aa9dd49474db8affbdd (diff) | |
download | cpython-fd036451bf0e0ade8783e21df801abf7be96d020.zip cpython-fd036451bf0e0ade8783e21df801abf7be96d020.tar.gz cpython-fd036451bf0e0ade8783e21df801abf7be96d020.tar.bz2 |
#2834: Change re module semantics, so that str and bytes mixing is forbidden,
and str (unicode) patterns get full unicode matching by default. The re.ASCII
flag is also introduced to ask for ASCII matching instead.
Diffstat (limited to 'Lib/_strptime.py')
-rw-r--r-- | Lib/_strptime.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/_strptime.py b/Lib/_strptime.py index c3568b0..896c798 100644 --- a/Lib/_strptime.py +++ b/Lib/_strptime.py @@ -14,7 +14,7 @@ import time import locale import calendar from re import compile as re_compile -from re import IGNORECASE +from re import IGNORECASE, ASCII from re import escape as re_escape from datetime import date as datetime_date try: @@ -262,7 +262,7 @@ class TimeRE(dict): def compile(self, format): """Return a compiled re object for the format string.""" - return re_compile(self.pattern(format), IGNORECASE) + return re_compile(self.pattern(format), IGNORECASE | ASCII) _cache_lock = _thread_allocate_lock() # DO NOT modify _TimeRE_cache or _regex_cache without acquiring the cache lock |