[qa] py2: Unfiddle strings into bytes explicitly

Github-Pull: #7853
Rebased-From: faa41ee204, fa7abe0a00

 Conflicts:
	qa/rpc-tests/invalidtxrequest.py
	qa/rpc-tests/p2p-feefilter.py
	qa/rpc-tests/proxy_test.py
	qa/rpc-tests/test_framework/mininode.py
	qa/rpc-tests/test_framework/netutil.py
	src/test/bctest.py
This commit is contained in:
MarcoFalke
2016-04-10 16:54:28 +02:00
parent c0d9e31611
commit f1f1b82033
27 changed files with 200 additions and 209 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)