support utf-8 encoding for PYTHON>=3

This commit is contained in:
byehack
2019-01-17 18:43:13 +03:30
committed by GitHub
parent ceae035c70
commit 138b2ac5ee

View File

@@ -40,10 +40,10 @@ def _get_outstream(outfile):
except OSError:
pass
if PYTHON_VERSION < 3.0:
mode = 'wb'
kw = {'mode':'wb'}
else:
mode = 'w'
return open(outfile, mode, encoding="utf-8")
kw= = {'mode':'w', 'encoding':'utf-8'}
return open(outfile, **kw)
def decompile(
bytecode_version, co, out=None, showasm=None, showast=False,