mirror of
				https://github.com/python/cpython.git
				synced 2025-10-31 05:31:20 +00:00 
			
		
		
		
	On OSX always copy PythonCore. It turns out an orphaned alias in /Library/CFMSupport (happens when you remove python and aliased pythoncore) wreaks havoc with the system.
This commit is contained in:
		
							parent
							
								
									9bfae985ab
								
							
						
					
					
						commit
						2e2546c5fd
					
				
					 1 changed files with 18 additions and 5 deletions
				
			
		|  | @ -70,6 +70,22 @@ def mkcorealias(src, altsrc): | ||||||
| 		os.unlink(dst) | 		os.unlink(dst) | ||||||
| 	except os.error: | 	except os.error: | ||||||
| 		pass | 		pass | ||||||
|  | 	do_copy = ask_copy() | ||||||
|  | 	if do_copy: | ||||||
|  | 		macostools.copy(os.path.join(sys.exec_prefix, src), dst) | ||||||
|  | 	else: | ||||||
|  | 		macostools.mkalias(os.path.join(sys.exec_prefix, src), dst) | ||||||
|  | 	return 1 | ||||||
|  | 	 | ||||||
|  | do_copy = None | ||||||
|  | def ask_copy(): | ||||||
|  | 	global do_copy | ||||||
|  | 	if do_copy != None: | ||||||
|  | 		return do_copy | ||||||
|  | 	# On OSX always copy | ||||||
|  | 	if gestalt.gestalt('sysv') > 0x9ff: | ||||||
|  | 		do_copy = 1 | ||||||
|  | 		return do_copy | ||||||
| 	do_copy = 0 | 	do_copy = 0 | ||||||
| 	if macfs.FSSpec(sys.exec_prefix).as_tuple()[0] != -1: # XXXX | 	if macfs.FSSpec(sys.exec_prefix).as_tuple()[0] != -1: # XXXX | ||||||
| 		try: | 		try: | ||||||
|  | @ -79,11 +95,8 @@ def mkcorealias(src, altsrc): | ||||||
| 				do_copy = 1 | 				do_copy = 1 | ||||||
| 		except ImportError: | 		except ImportError: | ||||||
| 			pass | 			pass | ||||||
| 	if do_copy: | 	return do_copy | ||||||
| 		macostools.copy(os.path.join(sys.exec_prefix, src), dst) | 	 | ||||||
| 	else: |  | ||||||
| 		macostools.mkalias(os.path.join(sys.exec_prefix, src), dst) |  | ||||||
| 	return 1 |  | ||||||
| 
 | 
 | ||||||
| # Copied from fullbuild, should probably go to buildtools | # Copied from fullbuild, should probably go to buildtools | ||||||
| def buildapplet(top, dummy, list): | def buildapplet(top, dummy, list): | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Jack Jansen
						Jack Jansen