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: except OSError:
pass pass
if PYTHON_VERSION < 3.0: if PYTHON_VERSION < 3.0:
kw = {'mode':'wb'} return open(outfile, mode='wb')
else: else:
kw= = {'mode':'w', 'encoding':'utf-8'} return open(outfile, mode='w', encoding='utf-8')
return open(outfile, **kw)
def decompile( def decompile(
bytecode_version, co, out=None, showasm=None, showast=False, bytecode_version, co, out=None, showasm=None, showast=False,