Ronald Oussoren  committed c21adfd

Earlier simplification of byte compilation code led to junk directories

An earlier check-in removed a special case for byte-compiling: source
files from the filesystem and source files from zipfiles are treated
the same. Sadly enough this used the code for zipped sources, which as
it turns out is broken and leads to junk directories on the fileystem.

This check-in fixes that problem.

  • Participants
  • Parent commits a30da2a
  • Branches default
  • Tags py2app-0.6

Comments (0)

Files changed (2)

File py2app/

         self.eggs = []
     def finalize_options (self):
-        if sys.version_info[0] == 3:
-            if self.argv_emulation:
+        if self.argv_emulation:
+            if sys.version_info[0] == 3:
                 raise DistutilsOptionError("argv-emulation is not supported on python 3.x")
-        else:
-            if sys.maxint > 2 ** 32:
+            elif sys.maxint > 2 ** 32:
                 raise DistutilsOptionError("argv-emulation is not supported for 64-bit executables")
         if not self.strip:

File py2app/

                 if not dry_run:
-                    mkpath(os.path.dirname(dfile))
                     suffix = os.path.splitext(mod.filename)[1]
                     if suffix in ('.py', '.pyw'):
-                        fn = dfile + '.py'
+                        fn = cfile + '.py'
                         fp_in =, 'rb')
                         fp_out = open(fn, 'wb')
+                        print "XXX byte-compiling fn=%s cfile=%s dfile=%s"%(fn, cfile, dfile)
                         compile(fn, cfile, dfile)