[Python-checkins] r84925 - in python/branches/py3k: Doc/library/sysconfig.rst Lib/sysconfig.py Lib/test/test_sysconfig.py Misc/NEWS
barry.warsaw
python-checkins at python.org
Mon Sep 20 17:29:53 CEST 2010
Author: barry.warsaw
Date: Mon Sep 20 17:29:53 2010
New Revision: 84925
Log:
Issue 9877: expose sysconfig.get_makefile_filename() in the public API.
Modified:
python/branches/py3k/Doc/library/sysconfig.rst
python/branches/py3k/Lib/sysconfig.py
python/branches/py3k/Lib/test/test_sysconfig.py
python/branches/py3k/Misc/NEWS
Modified: python/branches/py3k/Doc/library/sysconfig.rst
==============================================================================
--- python/branches/py3k/Doc/library/sysconfig.rst (original)
+++ python/branches/py3k/Doc/library/sysconfig.rst Mon Sep 20 17:29:53 2010
@@ -217,6 +217,10 @@
Return the path of :file:`pyconfig.h`.
+.. function:: get_makefile_filename()
+
+ Return the path of :file:`Makefile`.
+
Using :mod:`sysconfig` as a script
----------------------------------
Modified: python/branches/py3k/Lib/sysconfig.py
==============================================================================
--- python/branches/py3k/Lib/sysconfig.py (original)
+++ python/branches/py3k/Lib/sysconfig.py Mon Sep 20 17:29:53 2010
@@ -5,9 +5,19 @@
import os
from os.path import pardir, realpath
-__all__ = ['parse_config_h', 'get_config_h_filename', 'get_scheme_names',
- 'get_path_names', 'get_paths', 'get_path', 'get_config_vars',
- 'get_config_var', 'get_platform', 'get_python_version']
+__all__ = [
+ 'get_config_h_filename',
+ 'get_config_var',
+ 'get_config_vars',
+ 'get_makefile_filename',
+ 'get_path',
+ 'get_path_names',
+ 'get_paths',
+ 'get_platform',
+ 'get_python_version',
+ 'get_scheme_names',
+ 'parse_config_h',
+ ]
_INSTALL_SCHEMES = {
'posix_prefix': {
@@ -291,7 +301,7 @@
return vars
-def _get_makefile_filename():
+def get_makefile_filename():
if _PYTHON_BUILD:
return os.path.join(_PROJECT_BASE, "Makefile")
return os.path.join(get_path('stdlib'), "config", "Makefile")
@@ -300,7 +310,7 @@
def _init_posix(vars):
"""Initialize the module as appropriate for POSIX systems."""
# load the installed Makefile:
- makefile = _get_makefile_filename()
+ makefile = get_makefile_filename()
try:
_parse_makefile(makefile, vars)
except IOError as e:
Modified: python/branches/py3k/Lib/test/test_sysconfig.py
==============================================================================
--- python/branches/py3k/Lib/test/test_sysconfig.py (original)
+++ python/branches/py3k/Lib/test/test_sysconfig.py Mon Sep 20 17:29:53 2010
@@ -234,6 +234,10 @@
config_h = sysconfig.get_config_h_filename()
self.assertTrue(os.path.isfile(config_h), config_h)
+ def test_get_makefile_filename(self):
+ makefile = sysconfig.get_makefile_filename()
+ self.assertTrue(os.path.isfile(makefile), makefile)
+
def test_get_scheme_names(self):
wanted = ('nt', 'nt_user', 'os2', 'os2_home', 'osx_framework_user',
'posix_home', 'posix_prefix', 'posix_user')
Modified: python/branches/py3k/Misc/NEWS
==============================================================================
--- python/branches/py3k/Misc/NEWS (original)
+++ python/branches/py3k/Misc/NEWS Mon Sep 20 17:29:53 2010
@@ -55,6 +55,8 @@
Library
-------
+- Issue #9877: Expose sysconfig.get_makefile_filename()
+
- logging: Added hasHandlers() method to Logger and LoggerAdapter.
- Issue #1686: Fix string.Template when overriding the pattern attribute.
More information about the Python-checkins
mailing list