aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2018-03-05 17:31:48 +0100
committerWladimir J. van der Laan <laanwj@gmail.com>2018-03-05 17:32:42 +0100
commit07d2d2a21c508050ba0bbe9ba55d5756c96f8909 (patch)
treea01dc1db39da14546511c484d0e0e3c5255c3eab /test
parentce56fdd2e8cdf94fd0ab76d71adbfa755e23ce7d (diff)
parentfa41d68a2e3f2148c3539a11b61ff835e3141c0d (diff)
downloadbitcoin-07d2d2a21c508050ba0bbe9ba55d5756c96f8909.tar.xz
Merge #12475: qa: Fix python TypeError in script.py
fa41d68a2 qa: Fix python TypeError in script.py (MarcoFalke) Pull request description: `__repr__` returns string, so don't mix it with byte strings. This fixes ``` TypeError: %b requires a bytes-like object, or an object that implements __bytes__, not 'str' Tree-SHA512: fac06e083f245209bc8a36102217580b0f6186842f4e52a686225111b0b96ff93c301640ff5e7ddef6a5b4f1689071b16a9a8dc80f28e2b060ddee29edd24ec7
Diffstat (limited to 'test')
-rw-r--r--test/functional/test_framework/script.py4
1 files changed, 1 insertions, 3 deletions
diff --git a/test/functional/test_framework/script.py b/test/functional/test_framework/script.py
index dae8a4e569..6fe0b445da 100644
--- a/test/functional/test_framework/script.py
+++ b/test/functional/test_framework/script.py
@@ -526,11 +526,9 @@ class CScript(bytes):
yield CScriptOp(opcode)
def __repr__(self):
- # For Python3 compatibility add b before strings so testcases don't
- # need to change
def _repr(o):
if isinstance(o, bytes):
- return b"x('%s')" % hexlify(o).decode('ascii')
+ return "x('%s')" % hexlify(o).decode('ascii')
else:
return repr(o)