]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Fixed error position for the backslash at the end of regex pattern.
authorSerhiy Storchaka <storchaka@gmail.com>
Mon, 10 Nov 2014 16:28:53 +0000 (18:28 +0200)
committerSerhiy Storchaka <storchaka@gmail.com>
Mon, 10 Nov 2014 16:28:53 +0000 (18:28 +0200)
Lib/sre_parse.py

index fb622ec2357bee028715f5c76a05d42a0ed225a9..aa2d64bb40c048d4316f3919bd43793b895d82a6 100644 (file)
@@ -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):