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
9d6488a1
Commit
9d6488a1
authored
Aug 22, 2014
by
Ned Deily
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #22199: Make get_makefile_filename() available in Lib/sysconfig.py
for 2.7 to match other versions of sysconfig.
parent
983df868
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
2 deletions
+18
-2
Doc/library/sysconfig.rst
Doc/library/sysconfig.rst
+4
-0
Lib/sysconfig.py
Lib/sysconfig.py
+6
-2
Lib/test/test_sysconfig.py
Lib/test/test_sysconfig.py
+8
-0
No files found.
Doc/library/sysconfig.rst
View file @
9d6488a1
...
@@ -221,3 +221,7 @@ Other functions
...
@@ -221,3 +221,7 @@ Other functions
.. function:: get_config_h_filename()
.. function:: get_config_h_filename()
Return the path of :file:`pyconfig.h`.
Return the path of :file:`pyconfig.h`.
.. function:: get_makefile_filename()
Return the path of :file:`Makefile`.
Lib/sysconfig.py
View file @
9d6488a1
...
@@ -273,17 +273,21 @@ def _parse_makefile(filename, vars=None):
...
@@ -273,17 +273,21 @@ def _parse_makefile(filename, vars=None):
return vars
return vars
def _get_makefile_filename():
def get_makefile_filename():
"""Return the path of the Makefile."""
if _PYTHON_BUILD:
if _PYTHON_BUILD:
return os.path.join(_PROJECT_BASE, "
Makefile
")
return os.path.join(_PROJECT_BASE, "
Makefile
")
return os.path.join(get_path('platstdlib'), "
config
", "
Makefile
")
return os.path.join(get_path('platstdlib'), "
config
", "
Makefile
")
# Issue #22199: retain undocumented private name for compatibility
_get_makefile_filename = get_makefile_filename
def _generate_posix_vars():
def _generate_posix_vars():
"""Generate the Python module containing build-time variables."""
"""Generate the Python module containing build-time variables."""
import pprint
import pprint
vars = {}
vars = {}
# load the installed Makefile:
# load the installed Makefile:
makefile =
_
get_makefile_filename()
makefile = get_makefile_filename()
try:
try:
_parse_makefile(makefile, vars)
_parse_makefile(makefile, vars)
except IOError, e:
except IOError, e:
...
...
Lib/test/test_sysconfig.py
View file @
9d6488a1
...
@@ -243,6 +243,14 @@ class TestSysConfig(unittest.TestCase):
...
@@ -243,6 +243,14 @@ class TestSysConfig(unittest.TestCase):
'posix_home'
,
'posix_prefix'
,
'posix_user'
)
'posix_home'
,
'posix_prefix'
,
'posix_user'
)
self
.
assertEqual
(
get_scheme_names
(),
wanted
)
self
.
assertEqual
(
get_scheme_names
(),
wanted
)
@
unittest
.
skipIf
(
sys
.
platform
.
startswith
(
'win'
),
'Test is not Windows compatible'
)
def
test_get_makefile_filename
(
self
):
makefile
=
sysconfig
.
get_makefile_filename
()
self
.
assertTrue
(
os
.
path
.
isfile
(
makefile
),
makefile
)
# Issue 22199
self
.
assertEqual
(
sysconfig
.
_get_makefile_filename
(),
makefile
)
def
test_symlink
(
self
):
def
test_symlink
(
self
):
# Issue 7880
# Issue 7880
symlink
=
get_attribute
(
os
,
"symlink"
)
symlink
=
get_attribute
(
os
,
"symlink"
)
...
...
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