mirror of
https://github.com/dashpay/dash.git
synced 2024-12-27 04:52:59 +01:00
Merge #12475: qa: Fix python TypeError in script.py
fa41d68a2
qa: Fix python TypeError in script.py (MarcoFalke)
Pull request description:
`__repr__` returns string, so don't mix it with byte strings.
This fixes
```
TypeError: %b requires a bytes-like object, or an object that implements __bytes__, not 'str'
Tree-SHA512: fac06e083f245209bc8a36102217580b0f6186842f4e52a686225111b0b96ff93c301640ff5e7ddef6a5b4f1689071b16a9a8dc80f28e2b060ddee29edd24ec7
This commit is contained in:
parent
fa59296e74
commit
62bbabb6ac
@ -527,11 +527,9 @@ class CScript(bytes):
|
|||||||
yield CScriptOp(opcode)
|
yield CScriptOp(opcode)
|
||||||
|
|
||||||
def __repr__(self):
|
def __repr__(self):
|
||||||
# For Python3 compatibility add b before strings so testcases don't
|
|
||||||
# need to change
|
|
||||||
def _repr(o):
|
def _repr(o):
|
||||||
if isinstance(o, bytes):
|
if isinstance(o, bytes):
|
||||||
return b"x('%s')" % hexlify(o).decode('ascii')
|
return "x('%s')" % hexlify(o).decode('ascii')
|
||||||
else:
|
else:
|
||||||
return repr(o)
|
return repr(o)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user