Skip to content

Commit

Permalink
[test] functional framework: add CScript hex() for Python 3.4
Browse files Browse the repository at this point in the history
test/functional/wallet_importmulti.py failed with:
AttributeError: 'CScript' object has no attribute 'hex'
  • Loading branch information
Sjors committed Dec 12, 2018
1 parent 74ce326 commit 31926ee
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions test/functional/test_framework/script.py
Original file line number Diff line number Diff line change
Expand Up @@ -450,6 +450,10 @@ def join(self, iterable):
# 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)
Expand Down

0 comments on commit 31926ee

Please sign in to comment.