mirror of
https://github.com/bitcoin/bitcoin.git
synced 2024-11-20 02:25:40 +01: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:
parent
74ce326831
commit
31926ee8cf
@ -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…
Reference in New Issue
Block a user