[Python-checkins] cpython: Fixed error position for the backslash at the end of regex pattern.

serhiy.storchaka python-checkins at python.org
Tue Nov 11 08:48:03 CET 2014


https://hg.python.org/cpython/rev/2b27ffe611f3
changeset:   93466:2b27ffe611f3
parent:      93463:7972304b9f92
user:        Serhiy Storchaka <storchaka at gmail.com>
date:        Mon Nov 10 18:28:53 2014 +0200
summary:
  Fixed error position for the backslash at the end of regex pattern.

files:
  Lib/sre_parse.py |  3 ++-
  1 files changed, 2 insertions(+), 1 deletions(-)


diff --git a/Lib/sre_parse.py b/Lib/sre_parse.py
--- a/Lib/sre_parse.py
+++ b/Lib/sre_parse.py
@@ -225,7 +225,8 @@
             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):

-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list