diff options
Diffstat (limited to 'lab/show_pyc.py')
-rw-r--r-- | lab/show_pyc.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lab/show_pyc.py b/lab/show_pyc.py index 4a8801a..0a28e4f 100644 --- a/lab/show_pyc.py +++ b/lab/show_pyc.py @@ -17,6 +17,10 @@ def show_pyc_file(fname): modtime = time.asctime(time.localtime(struct.unpack('<L', moddate)[0])) print("magic %s" % (binascii.hexlify(magic))) print("moddate %s (%s)" % (binascii.hexlify(moddate), modtime)) + if sys.version_info >= (3, 3): + # 3.3 added another long to the header (size). + size = f.read(4) + print("pysize %s (%d)" % (binascii.hexlify(size), struct.unpack('<L', size)[0])) code = marshal.load(f) show_code(code) |