From fe65a26ab584bd70fad45c7c4d44330e30a748a4 Mon Sep 17 00:00:00 2001 From: Justus Winter Date: Mon, 13 Feb 2017 16:44:53 +0100 Subject: python: Use one copy of the source tree per Python version. * lang/python/Makefile.am (copystamp): Create one copy per Python version. (all-local): Adapt. (clean-local): Likewise. (install-exec-local): Likewise. * lang/python/tests/run-tests.py: Likewise. -- Currently, we use one copy of the Python module's source to build for all Python versions. This is problematic, because SWIG writes a wrapper file into the source tree. Currently, this file works with both Python 2 and 3, but this is purely by chance. Improve the situation by creating one copy per Python version so that SWIG can write version-specific code into each copy. Signed-off-by: Justus Winter --- lang/python/tests/run-tests.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lang/python/tests') diff --git a/lang/python/tests/run-tests.py b/lang/python/tests/run-tests.py index 46c6d8c8..e76acb2a 100644 --- a/lang/python/tests/run-tests.py +++ b/lang/python/tests/run-tests.py @@ -69,7 +69,9 @@ for interpreter in args.interpreters: version = subprocess.check_output( [interpreter, "-c", "import sys; print('{0}.{1}'.format(sys.version_info[0], sys.version_info[1]))"]).strip().decode() - builddirs = glob.glob(os.path.join(args.builddir, "..", "build", + builddirs = glob.glob(os.path.join(args.builddir, "..", + "python{0}-gpg".format(version), + "build", "lib*"+version)) assert len(builddirs) == 1, \ "Expected one build directory, got {0}".format(builddirs) -- cgit v1.2.3