summaryrefslogtreecommitdiffstats
path: root/Lib/distutils
diff options
context:
space:
mode:
authorNed Deily <nad@acm.org>2011-06-28 07:39:19 (GMT)
committerNed Deily <nad@acm.org>2011-06-28 07:39:19 (GMT)
commit63144c6444e34281398b4441d1f9321116943aa9 (patch)
treea8299390d07db4392c75624974e998a411ed09e8 /Lib/distutils
parent43e1054e38ebd3de91b51531cda8e2fd580c0207 (diff)
downloadcpython-63144c6444e34281398b4441d1f9321116943aa9.zip
cpython-63144c6444e34281398b4441d1f9321116943aa9.tar.gz
cpython-63144c6444e34281398b4441d1f9321116943aa9.tar.bz2
Issue #12141: Install a copy of template C module file so that
test_build_ext of test_distutils is no longer silently skipped when run outside of a build directory.
Diffstat (limited to 'Lib/distutils')
-rw-r--r--Lib/distutils/tests/test_build_ext.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/Lib/distutils/tests/test_build_ext.py b/Lib/distutils/tests/test_build_ext.py
index 46dcb5e..44fc980 100644
--- a/Lib/distutils/tests/test_build_ext.py
+++ b/Lib/distutils/tests/test_build_ext.py
@@ -19,6 +19,11 @@ from test import test_support
ALREADY_TESTED = False
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')
if srcdir is None:
return os.path.join(sysconfig.project_base, 'Modules', 'xxmodule.c')