]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Backport rev. 1.73: Translate spaces in the machine name to underscores
authorAndrew M. Kuchling <amk@amk.ca>
Wed, 26 Feb 2003 22:26:03 +0000 (22:26 +0000)
committerAndrew M. Kuchling <amk@amk.ca>
Wed, 26 Feb 2003 22:26:03 +0000 (22:26 +0000)
Lib/distutils/util.py

index abc91391e4154046ba215dd3048c0c3dd448734d..4792dae0d25b0ae526f1c2529c08e223a42ce730 100644 (file)
@@ -42,10 +42,11 @@ def get_platform ():
 
     (osname, host, release, version, machine) = os.uname()
 
-    # Convert the OS name to lowercase and remove '/' characters
-    # (to accommodate BSD/OS)
+    # Convert the OS name to lowercase, remove '/' characters
+    # (to accommodate BSD/OS), and translate spaces (for "Power Macintosh")
     osname = string.lower(osname)
     osname = string.replace(osname, '/', '')
+    machine = string.replace(machine, ' ', '_')
 
     if osname[:5] == "linux":
         # At least on Linux/Intel, 'machine' is the processor --