Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
585df89f
Commit
585df89f
authored
Mar 01, 2000
by
Greg Ward
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added 'get_platform()' to construct a string that identifies the current
platform, using 'os.uname()' or 'sys.platform'.
parent
e51d69ef
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
1 deletion
+19
-1
Lib/distutils/util.py
Lib/distutils/util.py
+19
-1
No files found.
Lib/distutils/util.py
View file @
585df89f
...
...
@@ -11,7 +11,7 @@ file causing it."""
__rcsid__
=
"$Id$"
import
os
import
os
,
string
from
distutils.errors
import
*
...
...
@@ -437,3 +437,21 @@ def write_file (filename, contents):
for
line
in
contents
:
f
.
write
(
line
+
"
\
n
"
)
f
.
close
()
def
get_platform
():
"""Return a string (suitable for tacking onto directory names) that
identifies the current platform. Under Unix, identifies both the OS
and hardware architecture, e.g. "linux-i586", "solaris-sparc",
"irix-mips". For Windows and Mac OS, just returns 'sys.platform' --
i.e. "???" or "???"."""
if
os
.
name
==
'posix'
:
uname
=
os
.
uname
()
OS
=
uname
[
0
]
arch
=
uname
[
4
]
return
"%s-%s"
%
(
string
.
lower
(
OS
),
string
.
lower
(
arch
))
else
:
return
sys
.
platform
# get_platform()
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment