From 22628c4d6a79e38371e383cc40702bf0935e355e Mon Sep 17 00:00:00 2001 From: Antoine Pitrou Date: Tue, 22 Jul 2008 17:53:22 +0000 Subject: [PATCH] #3231: re.compile fails with some bytes patterns --- Lib/sre_parse.py | 2 +- Lib/test/re_tests.py | 8 ++------ Lib/test/test_re.py | 43 +++++++++++++++++++++++-------------------- 3 files changed, 26 insertions(+), 27 deletions(-) diff --git a/Lib/sre_parse.py b/Lib/sre_parse.py index 6e7002457b..ffa8902b7b 100644 --- a/Lib/sre_parse.py +++ b/Lib/sre_parse.py @@ -200,7 +200,7 @@ class Tokenizer: except IndexError: raise error("bogus escape (end of line)") if isinstance(self.string, bytes): - char = chr(c) + c = chr(c) char = char + c self.index = self.index + len(char) self.next = char diff --git a/Lib/test/re_tests.py b/Lib/test/re_tests.py index 25b1229d63..220301ad29 100755 --- a/Lib/test/re_tests.py +++ b/Lib/test/re_tests.py @@ -661,12 +661,8 @@ xyzabc ('^([ab]*?)(?