summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2014-11-10 16:28:53 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2014-11-10 16:28:53 (GMT)
commit1b2004f0599693da3add850b9e1eebc2acb07bf0 (patch)
treeb52300dbdce8200ae18637efe90ed3ebd2c86c8d
parentb99c132bd9030883f7a3482feb5e2b38c02f4188 (diff)
downloadcpython-1b2004f0599693da3add850b9e1eebc2acb07bf0.zip
cpython-1b2004f0599693da3add850b9e1eebc2acb07bf0.tar.gz
cpython-1b2004f0599693da3add850b9e1eebc2acb07bf0.tar.bz2
Fixed error position for the backslash at the end of regex pattern.
-rw-r--r--Lib/sre_parse.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/sre_parse.py b/Lib/sre_parse.py
index fb622ec..aa2d64b 100644
--- a/Lib/sre_parse.py
+++ b/Lib/sre_parse.py
@@ -225,7 +225,8 @@ class Tokenizer:
try:
char += self.decoded_string[index]
except IndexError:
- raise self.error("bogus escape (end of line)") from None
+ raise error("bogus escape (end of line)",
+ self.string, len(self.string) - 1) from None
self.index = index + 1
self.next = char
def match(self, char):