mirror of
https://github.com/python/cpython.git
synced 2025-09-26 10:19:53 +00:00
Issue #12141: Install copies of template C module file so that
test_build_ext of test_distutils and test_command_build_ext of test_packaging are no longer silently skipped when run outside of a build directory.
This commit is contained in:
commit
4a1ec12999
4 changed files with 24 additions and 1 deletions
|
@ -14,6 +14,11 @@ from packaging.tests import support, unittest, verbose, unload
|
|||
|
||||
|
||||
def _get_source_filename():
|
||||
# use installed copy if available
|
||||
tests_f = os.path.join(os.path.dirname(__file__), 'xxmodule.c')
|
||||
if os.path.exists(tests_f):
|
||||
return tests_f
|
||||
# otherwise try using copy from build directory
|
||||
srcdir = sysconfig.get_config_var('srcdir')
|
||||
return os.path.join(srcdir, 'Modules', 'xxmodule.c')
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue