From 1b2004f0599693da3add850b9e1eebc2acb07bf0 Mon Sep 17 00:00:00 2001 From: Serhiy Storchaka Date: Mon, 10 Nov 2014 18:28:53 +0200 Subject: [PATCH] Fixed error position for the backslash at the end of regex pattern. --- Lib/sre_parse.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Lib/sre_parse.py b/Lib/sre_parse.py index fb622ec2357..aa2d64bb40c 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):