Issue #23681: Fixed Python 2 to 3 poring bugs.

Indexing bytes retiurns an integer, not bytes.
This commit is contained in:
Serhiy Storchaka 2015-03-20 16:46:19 +02:00
parent d83b7c2df4
commit 74a49ac3f5
5 changed files with 12 additions and 14 deletions

View file

@ -145,7 +145,7 @@ def decode(input, output, header=False):
new = new + c; i = i+1
elif i+1 == n and not partial:
partial = 1; break
elif i+1 < n and line[i+1] == ESCAPE:
elif i+1 < n and line[i+1:i+2] == ESCAPE:
new = new + ESCAPE; i = i+2
elif i+2 < n and ishex(line[i+1:i+2]) and ishex(line[i+2:i+3]):
new = new + bytes((unhex(line[i+1:i+3]),)); i = i+3