mirror of
https://github.com/python/cpython.git
synced 2025-08-02 16:13:13 +00:00
Issue #27030: Unknown escapes in re.sub() replacement template are allowed
again. But they still are deprecated and will be disabled in 3.7.
This commit is contained in:
parent
b0f75c520e
commit
53c53ea4c5
5 changed files with 16 additions and 5 deletions
|
@ -947,7 +947,9 @@ def parse_template(source, pattern):
|
|||
this = chr(ESCAPES[this][1])
|
||||
except KeyError:
|
||||
if c in ASCIILETTERS:
|
||||
raise s.error('bad escape %s' % this, len(this))
|
||||
import warnings
|
||||
warnings.warn('bad escape %s' % this,
|
||||
DeprecationWarning, stacklevel=4)
|
||||
lappend(this)
|
||||
else:
|
||||
lappend(this)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue