Commits

Anthony Tuininga committed aeaa5ba

Ensure that if a target name is specified, that the module name in the zip
file is also changed. Thanks to Clemens Hermann for the initial patch.

  • Participants
  • Parent commits 5b07d2e

Comments (0)

Files changed (1)

File cx_Freeze/freezer.py

             freezer._VerifyCanAppendToLibrary()
         if self.icon is None:
             self.icon = freezer.icon
-        if self.script is not None:
+        if self.targetName is None:
             name, ext = os.path.splitext(os.path.basename(self.script))
-            if self.appendScriptToLibrary:
-                self.moduleName = "%s__main__" % os.path.normcase(name)
-            else:
-                self.moduleName = "__main__"
-        if self.targetName is None:
             baseName, ext = os.path.splitext(self.base)
             self.targetName = name + ext
+        if self.appendScriptToLibrary:
+            name, ext = os.path.splitext(self.targetName)
+            self.moduleName = "%s__main__" % os.path.normcase(name)
+        else:
+            self.moduleName = "__main__"
         self.targetName = os.path.join(self.targetDir, self.targetName)