(stream)
| 38 | |
| 39 | |
| 40 | def read_code(stream): |
| 41 | # This helper is needed in order for the PEP 302 emulation to |
| 42 | # correctly handle compiled files |
| 43 | import marshal |
| 44 | |
| 45 | magic = stream.read(4) |
| 46 | if magic != importlib.util.MAGIC_NUMBER: |
| 47 | return None |
| 48 | |
| 49 | stream.read(12) # Skip rest of the header |
| 50 | return marshal.load(stream) |
| 51 | |
| 52 | |
| 53 | def walk_packages(path=None, prefix='', onerror=None): |
no test coverage detected