mirror of
				https://github.com/python/cpython.git
				synced 2025-11-03 19:34:08 +00:00 
			
		
		
		
	restore 2.2 compatibility:
- don't use "abc" in aString - don't reorganize extension modules when not using zipimport
This commit is contained in:
		
							parent
							
								
									762d2cce6f
								
							
						
					
					
						commit
						79b0ae12fd
					
				
					 1 changed files with 11 additions and 11 deletions
				
			
		| 
						 | 
					@ -310,6 +310,9 @@ PYTHONFRAMEWORKGOODIES = [
 | 
				
			||||||
    "Resources/version.plist",
 | 
					    "Resources/version.plist",
 | 
				
			||||||
]
 | 
					]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def isFramework():
 | 
				
			||||||
 | 
					    return sys.exec_prefix.find("Python.framework") > 0
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
LIB = os.path.join(sys.prefix, "lib", "python" + sys.version[:3])
 | 
					LIB = os.path.join(sys.prefix, "lib", "python" + sys.version[:3])
 | 
				
			||||||
SITE_PACKAGES = os.path.join(LIB, "site-packages")
 | 
					SITE_PACKAGES = os.path.join(LIB, "site-packages")
 | 
				
			||||||
| 
						 | 
					@ -400,7 +403,7 @@ class AppBuilder(BundleBuilder):
 | 
				
			||||||
            self.name += ".app"
 | 
					            self.name += ".app"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if self.executable is None:
 | 
					        if self.executable is None:
 | 
				
			||||||
            if not self.standalone:
 | 
					            if not self.standalone and not isFramework():
 | 
				
			||||||
                self.symlink_exec = 1
 | 
					                self.symlink_exec = 1
 | 
				
			||||||
            self.executable = sys.executable
 | 
					            self.executable = sys.executable
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -409,7 +412,7 @@ class AppBuilder(BundleBuilder):
 | 
				
			||||||
            if not hasattr(self.plist, "NSPrincipalClass"):
 | 
					            if not hasattr(self.plist, "NSPrincipalClass"):
 | 
				
			||||||
                self.plist.NSPrincipalClass = "NSApplication"
 | 
					                self.plist.NSPrincipalClass = "NSApplication"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if self.standalone and "Python.framework" in sys.exec_prefix:
 | 
					        if self.standalone and isFramework():
 | 
				
			||||||
            self.addPythonFramework()
 | 
					            self.addPythonFramework()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        BundleBuilder.setup(self)
 | 
					        BundleBuilder.setup(self)
 | 
				
			||||||
| 
						 | 
					@ -619,16 +622,13 @@ class AppBuilder(BundleBuilder):
 | 
				
			||||||
            if path and mod.__code__ is None:
 | 
					            if path and mod.__code__ is None:
 | 
				
			||||||
                # C extension
 | 
					                # C extension
 | 
				
			||||||
                filename = os.path.basename(path)
 | 
					                filename = os.path.basename(path)
 | 
				
			||||||
                dstpath = name.split(".")[:-1] + [filename]
 | 
					                pathitems = name.split(".")[:-1] + [filename]
 | 
				
			||||||
                if name != "zlib":
 | 
					                dstpath = pathjoin(*pathitems)
 | 
				
			||||||
                    # put all extension module in a separate folder
 | 
					 | 
				
			||||||
                    # inside Contents/Resources/
 | 
					 | 
				
			||||||
                    dstpath = pathjoin("ExtensionModules", *dstpath)
 | 
					 | 
				
			||||||
                else:
 | 
					 | 
				
			||||||
                    # zlib is neccesary for bootstrapping, so don't
 | 
					 | 
				
			||||||
                    # hide it in "ExtensionModules"
 | 
					 | 
				
			||||||
                    dstpath = pathjoin(*dstpath)
 | 
					 | 
				
			||||||
                if USE_ZIPIMPORT:
 | 
					                if USE_ZIPIMPORT:
 | 
				
			||||||
 | 
					                    if name != "zlib":
 | 
				
			||||||
 | 
					                        # neatly pack all extension modules in a subdirectory,
 | 
				
			||||||
 | 
					                        # except zlib, since it's neccesary for bootstrapping.
 | 
				
			||||||
 | 
					                        dstpath = pathjoin("ExtensionModules", dstpath)
 | 
				
			||||||
                    # Python modules are stored in a Zip archive, but put
 | 
					                    # Python modules are stored in a Zip archive, but put
 | 
				
			||||||
                    # extensions in Contents/Resources/. Add a tiny "loader"
 | 
					                    # extensions in Contents/Resources/. Add a tiny "loader"
 | 
				
			||||||
                    # program in the Zip archive. Due to Thomas Heller.
 | 
					                    # program in the Zip archive. Due to Thomas Heller.
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue