support utf-8 in py3

This commit is contained in:
byehack
2019-01-17 18:52:40 +03:30
committed by GitHub
parent 138b2ac5ee
commit 0c5f0dfc7a

View File

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