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:
Ned Deily 2011-06-28 00:53:54 -07:00
commit 4a1ec12999
4 changed files with 24 additions and 1 deletions

View file

@ -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')