Commits

Anthony Tuininga committed 758ab70

If import is deferred, do NOT store the name in the globals or any attempt to
import submodules is automatically defeated!

Comments (0)

Files changed (1)

cx_Freeze/finder.py

                     name = co.co_varnames[opArg]
                 else:
                     name = co.co_names[opArg]
-                module.globalNames[name] = None
+                storeName = True
+                if deferredImports:
+                    deferredCaller, deferredPackage, deferredFromList = \
+                            deferredImports[-1]
+                    storeName = deferredCaller is not module
+                if storeName:
+                    module.globalNames[name] = None
             elif op == IMPORT_STAR and topLevel and importedModule is not None:
                 module.globalNames.update(importedModule.globalNames)
                 arguments = []