mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-08-28 03:36:28 +02:00
[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:
@@ -450,6 +450,10 @@ class CScript(bytes):
|
|||||||
# join makes no sense for a CScript()
|
# join makes no sense for a CScript()
|
||||||
raise NotImplementedError
|
raise NotImplementedError
|
||||||
|
|
||||||
|
# Python 3.4 compatibility
|
||||||
|
def hex(self):
|
||||||
|
return hexlify(self).decode('ascii')
|
||||||
|
|
||||||
def __new__(cls, value=b''):
|
def __new__(cls, value=b''):
|
||||||
if isinstance(value, bytes) or isinstance(value, bytearray):
|
if isinstance(value, bytes) or isinstance(value, bytearray):
|
||||||
return super(CScript, cls).__new__(cls, value)
|
return super(CScript, cls).__new__(cls, value)
|
||||||
|
Reference in New Issue
Block a user