[Test] MiniNode: Coerce OP_PUSHDATA bytearrays to bytes

If a bytearray is passed in as part of an iterable, the CScript constructor
fails because b''.join() cannot be used to join a bytearray to a bytes or str in
Python 2.
This commit is contained in:
Jack Grigg 2017-10-04 00:28:40 +01:00
parent 643235859a
commit 7596a4922d
No known key found for this signature in database
GPG Key ID: 665DBCD284F7DAFF
1 changed files with 1 additions and 1 deletions

View File

@ -666,7 +666,7 @@ class CScript(bytes):
else:
other = CScriptOp.encode_op_pushdata(bignum.bn2vch(other))
elif isinstance(other, (bytes, bytearray)):
other = CScriptOp.encode_op_pushdata(other)
other = bytes(CScriptOp.encode_op_pushdata(other))
return other
def __add__(self, other):