[test] functional framework: add CScript hex() for Python 3.4
test/functional/wallet_importmulti.py failed with: AttributeError: 'CScript' object has no attribute 'hex'
This commit is contained in:
parent
74ce326831
commit
31926ee8cf
1 changed files with 4 additions and 0 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Reference in a new issue