aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorSjors Provoost <sjors@sprovoost.nl>2018-12-12 11:08:53 +0100
committerSjors Provoost <sjors@sprovoost.nl>2018-12-12 11:09:04 +0100
commit31926ee8cfc73501524dfa0fef2ccbaa786d6a00 (patch)
tree37e0e33ffb3b00d782e12039983815bd9c469b94 /test
parent74ce32683199b987e45eb16f0320ae392ff10edc (diff)
downloadbitcoin-31926ee8cfc73501524dfa0fef2ccbaa786d6a00.tar.xz
[test] functional framework: add CScript hex() for Python 3.4
test/functional/wallet_importmulti.py failed with: AttributeError: 'CScript' object has no attribute 'hex'
Diffstat (limited to 'test')
-rw-r--r--test/functional/test_framework/script.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/test/functional/test_framework/script.py b/test/functional/test_framework/script.py
index 2c5ba24a6a..012c80a1be 100644
--- a/test/functional/test_framework/script.py
+++ b/test/functional/test_framework/script.py
@@ -450,6 +450,10 @@ class CScript(bytes):
# join makes no sense for a CScript()
raise NotImplementedError
+ # Python 3.4 compatibility
+ def hex(self):
+ return hexlify(self).decode('ascii')
+
def __new__(cls, value=b''):
if isinstance(value, bytes) or isinstance(value, bytearray):
return super(CScript, cls).__new__(cls, value)