diff options
author | Thomas Wouters <thomas@python.org> | 2008-03-18 20:19:54 +0000 |
---|---|---|
committer | Thomas Wouters <thomas@python.org> | 2008-03-18 20:19:54 +0000 |
commit | fc4a00af583b5dea131739bb88226b9453c5f49e (patch) | |
tree | 379068771cd6f9431a67fffcc3e7aea47b3d85d3 /Lib/sre_parse.py | |
parent | c93a806a918aae2a1a5da896d1e24672c0fbb5f6 (diff) | |
download | cpython-fc4a00af583b5dea131739bb88226b9453c5f49e.tar.gz |
Fix 're' to work on bytes. It could do with a few more tests, though.
Diffstat (limited to 'Lib/sre_parse.py')
-rw-r--r-- | Lib/sre_parse.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/sre_parse.py b/Lib/sre_parse.py index a04c3432a6..6e7002457b 100644 --- a/Lib/sre_parse.py +++ b/Lib/sre_parse.py @@ -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] |