]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Fix for bug #113693: with the changes to the IMPORT_FROM opcodes, this
authorGuido van Rossum <guido@python.org>
Fri, 15 Sep 2000 16:37:42 +0000 (16:37 +0000)
committerGuido van Rossum <guido@python.org>
Fri, 15 Sep 2000 16:37:42 +0000 (16:37 +0000)
crashed on an assert.

Tools/freeze/modulefinder.py

index a75e2f3f750cfba3e807de2d792365c8334e71f1..e84a54128f6f932c000fb35701c47ac72a9edb34 100644 (file)
@@ -21,6 +21,10 @@ if sys.platform=="win32":
 
 IMPORT_NAME = dis.opname.index('IMPORT_NAME')
 IMPORT_FROM = dis.opname.index('IMPORT_FROM')
+STORE_NAME = dis.opname.index('STORE_NAME')
+STORE_FAST = dis.opname.index('STORE_FAST')
+STORE_GLOBAL = dis.opname.index('STORE_GLOBAL')
+STORE_OPS = [STORE_NAME, STORE_FAST, STORE_GLOBAL]
 
 # Modulefinder does a good job at simulating Python's, but it can not
 # handle __path__ modifications packages make at runtime.  Therefore there
@@ -296,6 +300,9 @@ class ModuleFinder:
                         if not self.badmodules.has_key(fullname):
                             self.badmodules[fullname] = {}
                         self.badmodules[fullname][m.__name__] = None
+            elif op in STORE_OPS:
+                # Skip; each IMPORT_FROM is followed by a STORE_* opcode
+                pass
             else:
                 lastname = None
         for c in co.co_consts: