mirror of
https://github.com/python/cpython.git
synced 2025-07-12 13:55:34 +00:00
Fix 're' to work on bytes. It could do with a few more tests, though.
This commit is contained in:
parent
e8c3d266c8
commit
40a088dc27
3 changed files with 22 additions and 34 deletions
|
@ -192,8 +192,8 @@ class Tokenizer:
|
|||
char = self.string[self.index:self.index+1]
|
||||
# Special case for the str8, since indexing returns a integer
|
||||
# XXX This is only needed for test_bug_926075 in test_re.py
|
||||
if isinstance(self.string, bytes):
|
||||
char = chr(char)
|
||||
if char and isinstance(char, bytes):
|
||||
char = chr(char[0])
|
||||
if char == "\\":
|
||||
try:
|
||||
c = self.string[self.index + 1]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue