mirror of
				https://github.com/python/cpython.git
				synced 2025-10-31 13:41:24 +00:00 
			
		
		
		
	Translate spaces in the machine name to underscores
(Power Macintosh -> Power_Macintosh)
This commit is contained in:
		
							parent
							
								
									1772f17666
								
							
						
					
					
						commit
						b8c7b9f0cc
					
				
					 1 changed files with 3 additions and 2 deletions
				
			
		|  | @ -40,10 +40,11 @@ def get_platform (): | ||||||
| 
 | 
 | ||||||
|     (osname, host, release, version, machine) = os.uname() |     (osname, host, release, version, machine) = os.uname() | ||||||
| 
 | 
 | ||||||
|     # Convert the OS name to lowercase and remove '/' characters |     # Convert the OS name to lowercase, remove '/' characters | ||||||
|     # (to accommodate BSD/OS) |     # (to accommodate BSD/OS), and translate spaces (for "Power Macintosh") | ||||||
|     osname = string.lower(osname) |     osname = string.lower(osname) | ||||||
|     osname = string.replace(osname, '/', '') |     osname = string.replace(osname, '/', '') | ||||||
|  |     machine = string.replace(machine, ' ', '_') | ||||||
| 
 | 
 | ||||||
|     if osname[:5] == "linux": |     if osname[:5] == "linux": | ||||||
|         # At least on Linux/Intel, 'machine' is the processor -- |         # At least on Linux/Intel, 'machine' is the processor -- | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Andrew M. Kuchling
						Andrew M. Kuchling