diff options
author | Steve Dower <steve.dower@microsoft.com> | 2017-02-04 15:05:50 -0800 |
---|---|---|
committer | Steve Dower <steve.dower@microsoft.com> | 2017-02-04 15:05:50 -0800 |
commit | 3b0e4320092ac0504b6670cafaf0301b908c91fc (patch) | |
tree | d3be1b6b844d61763bb366fa21ceed475e5703fd /Lib/sre_parse.py | |
parent | b2fa705fd3887c326e811c418469c784353027f4 (diff) | |
parent | f687fbcd73c14dfcbe086eb5cd94b298f1e81e72 (diff) | |
download | cpython-3b0e4320092ac0504b6670cafaf0301b908c91fc.tar.gz |
Issue #29392: Prevent crash when passing invalid arguments into msvcrt module.
Diffstat (limited to 'Lib/sre_parse.py')
-rw-r--r-- | Lib/sre_parse.py | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/Lib/sre_parse.py b/Lib/sre_parse.py index 6aa49c3bf6..ab37fd3fe2 100644 --- a/Lib/sre_parse.py +++ b/Lib/sre_parse.py @@ -947,9 +947,7 @@ def parse_template(source, pattern): this = chr(ESCAPES[this][1]) except KeyError: if c in ASCIILETTERS: - import warnings - warnings.warn('bad escape %s' % this, - DeprecationWarning, stacklevel=4) + raise s.error('bad escape %s' % this, len(this)) lappend(this) else: lappend(this) |