Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b8c7b9f

Browse files
committed
Translate spaces in the machine name to underscores
(Power Macintosh -> Power_Macintosh)
1 parent 1772f17 commit b8c7b9f

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

Lib/distutils/util.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,11 @@ def get_platform ():
4040

4141
(osname, host, release, version, machine) = os.uname()
4242

43-
# Convert the OS name to lowercase and remove '/' characters
44-
# (to accommodate BSD/OS)
43+
# Convert the OS name to lowercase, remove '/' characters
44+
# (to accommodate BSD/OS), and translate spaces (for "Power Macintosh")
4545
osname = string.lower(osname)
4646
osname = string.replace(osname, '/', '')
47+
machine = string.replace(machine, ' ', '_')
4748

4849
if osname[:5] == "linux":
4950
# At least on Linux/Intel, 'machine' is the processor --

0 commit comments

Comments
 (0)