tests: Improve bytes python3 compatibility
This commit is contained in:
committed by
Paul Beckingham
parent
b8347821c4
commit
a4ce40add4
@@ -464,7 +464,7 @@ def mkstemp(data):
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
f = tempfile.NamedTemporaryFile(delete=False)
|
f = tempfile.NamedTemporaryFile(delete=False)
|
||||||
f.write(data)
|
f.write(data.encode('utf-8') if not isinstance(data, bytes) else data)
|
||||||
f.close()
|
f.close()
|
||||||
|
|
||||||
# Ensure removal at end of python session
|
# Ensure removal at end of python session
|
||||||
|
|||||||
Reference in New Issue
Block a user