forked from Rust-related/RustPython
17
Lib/dis.py
vendored
17
Lib/dis.py
vendored
@@ -1 +1,18 @@
|
||||
from _dis import *
|
||||
|
||||
|
||||
# Disassembling a file by following cpython Lib/dis.py
|
||||
def _test():
|
||||
"""Simple test program to disassemble a file."""
|
||||
import argparse
|
||||
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument('infile', type=argparse.FileType('rb'), nargs='?', default='-')
|
||||
args = parser.parse_args()
|
||||
with args.infile as infile:
|
||||
source = infile.read()
|
||||
code = compile(source, args.infile.name, "exec")
|
||||
dis(code)
|
||||
|
||||
if __name__ == "__main__":
|
||||
_test()
|
||||
|
||||
Reference in New Issue
Block a user