Added the disassemble_pyc tool.

This commit is contained in:
Andrew Hamilton 2016-02-10 19:30:30 +00:00
parent 6807711384
commit 1106819e42
4 changed files with 8 additions and 3 deletions

View file

@ -396,7 +396,8 @@ def python_tidy(path): # Deps: found on internet?
def disassemble_pyc(path):
bytecode = open(path, "rb").read()
with open(path, "rb") as file_:
bytecode = file_.read()
stringio = io.StringIO()
dis.dis(bytecode, file=stringio)
stringio.seek(0)