diff options
author | Tarek Ziadé <ziade.tarek@gmail.com> | 2010-01-29 11:46:31 (GMT) |
---|---|---|
committer | Tarek Ziadé <ziade.tarek@gmail.com> | 2010-01-29 11:46:31 (GMT) |
commit | 8b441d0dcdb9380e999f0caead087c4365cb0bdd (patch) | |
tree | 6afac21467fdfacecb62658f96fc847aace4731b /Lib/distutils/util.py | |
parent | edacea30e457e151611a9fe560120cedb3bdc527 (diff) | |
download | cpython-8b441d0dcdb9380e999f0caead087c4365cb0bdd.zip cpython-8b441d0dcdb9380e999f0caead087c4365cb0bdd.tar.gz cpython-8b441d0dcdb9380e999f0caead087c4365cb0bdd.tar.bz2 |
Merged revisions 77759,77761 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r77759 | tarek.ziade | 2010-01-26 22:21:54 +0100 (Tue, 26 Jan 2010) | 1 line
reintroduced the names in Distutils for APIs that were relocated
........
r77761 | tarek.ziade | 2010-01-26 23:46:15 +0100 (Tue, 26 Jan 2010) | 1 line
added local get_platform/set_platform APIs in distutils.sysconfig
........
Diffstat (limited to 'Lib/distutils/util.py')
-rw-r--r-- | Lib/distutils/util.py | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/Lib/distutils/util.py b/Lib/distutils/util.py index 0515fef..8fd2ca0 100644 --- a/Lib/distutils/util.py +++ b/Lib/distutils/util.py @@ -16,6 +16,27 @@ from distutils.version import LooseVersion from distutils.errors import DistutilsByteCompileError _sysconfig = __import__('sysconfig') +_PLATFORM = None + +def get_platform(): + """Return a string that identifies the current platform. + + By default, will return the value returned by sysconfig.get_platform(), + but it can be changed by calling set_platform(). + """ + global _PLATFORM + if _PLATFORM is None: + _PLATFORM = _sysconfig.get_platform() + return _PLATFORM + +def set_platform(identifier): + """Sets the platform string identifier returned by get_platform(). + + Note that this change doesn't impact the value returned by + sysconfig.get_platform() and is local to Distutils + """ + global _PLATFORM + _PLATFORM = identifier def convert_path(pathname): """Return 'pathname' as a name that will work on the native filesystem. |