[qa] py2: Unfiddle strings into bytes explicitly

This commit is contained in:
MarcoFalke
2016-04-10 16:54:28 +02:00
parent 0afac87e81
commit faa41ee204
28 changed files with 205 additions and 213 deletions

View File

@@ -629,7 +629,7 @@ class CScriptNum(object):
neg = obj.value < 0
absvalue = -obj.value if neg else obj.value
while (absvalue):
r.append(chr(absvalue & 0xff))
r.append(absvalue & 0xff)
absvalue >>= 8
if r[-1] & 0x80:
r.append(0x80 if neg else 0)
@@ -777,7 +777,7 @@ class CScript(bytes):
# need to change
def _repr(o):
if isinstance(o, bytes):
return "x('%s')" % hexlify(o).decode('utf8')
return b"x('%s')" % hexlify(o).decode('ascii')
else:
return repr(o)