From 31926ee8cfc73501524dfa0fef2ccbaa786d6a00 Mon Sep 17 00:00:00 2001 From: Sjors Provoost Date: Wed, 12 Dec 2018 11:08:53 +0100 Subject: [test] functional framework: add CScript hex() for Python 3.4 test/functional/wallet_importmulti.py failed with: AttributeError: 'CScript' object has no attribute 'hex' --- test/functional/test_framework/script.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'test/functional/test_framework/script.py') 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) -- cgit v1.2.3