#3231: re.compile fails with some bytes patterns

This commit is contained in:
Antoine Pitrou 2008-07-22 17:53:22 +00:00
parent 943f33912c
commit 22628c4d6a
3 changed files with 26 additions and 27 deletions

View file

@ -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