Disassemble Python byte-code file (.pyc). If given a Python source file (".py") file, we'll try to find the corresponding compiled object.
(filename, outstream=None)
| 100 | |
| 101 | |
| 102 | def disassemble_file(filename, outstream=None): |
| 103 | """ |
| 104 | Disassemble Python byte-code file (.pyc). |
| 105 | |
| 106 | If given a Python source file (".py") file, we'll |
| 107 | try to find the corresponding compiled object. |
| 108 | """ |
| 109 | filename = check_object_path(filename) |
| 110 | (version, timestamp, magic_int, co, is_pypy, source_size, sip_hash) = load_module( |
| 111 | filename |
| 112 | ) |
| 113 | if type(co) == list: |
| 114 | for con in co: |
| 115 | disco(version, con, outstream) |
| 116 | else: |
| 117 | disco(version, co, outstream, is_pypy=is_pypy) |
| 118 | |
| 119 | |
| 120 | def _test(): |