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
ebbef6fe
Commit
ebbef6fe
authored
Sep 20, 2010
by
Barry Warsaw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue 9877: expose sysconfig.get_makefile_filename() in the public API.
parent
18cc344c
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
25 additions
and
5 deletions
+25
-5
Doc/library/sysconfig.rst
Doc/library/sysconfig.rst
+4
-0
Lib/sysconfig.py
Lib/sysconfig.py
+15
-5
Lib/test/test_sysconfig.py
Lib/test/test_sysconfig.py
+4
-0
Misc/NEWS
Misc/NEWS
+2
-0
No files found.
Doc/library/sysconfig.rst
View file @
ebbef6fe
...
...
@@ -217,6 +217,10 @@ Other functions
Return the path of :file:`pyconfig.h`.
.. function:: get_makefile_filename()
Return the path of :file:`Makefile`.
Using :mod:`sysconfig` as a script
----------------------------------
...
...
Lib/sysconfig.py
View file @
ebbef6fe
...
...
@@ -5,9 +5,19 @@ import sys
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 @@ def _parse_makefile(filename, vars=None):
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 _get_makefile_filename():
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:
...
...
Lib/test/test_sysconfig.py
View file @
ebbef6fe
...
...
@@ -234,6 +234,10 @@ class TestSysConfig(unittest.TestCase):
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'
)
...
...
Misc/NEWS
View file @
ebbef6fe
...
...
@@ -55,6 +55,8 @@ Core and Builtins
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.
...
...
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