Use same Python version for subprocess test
authorDebian Science Maintainers <debian-science-maintainers@lists.alioth.debian.org>
Tue, 28 Jan 2020 22:29:29 +0000 (22:29 +0000)
committerRebecca N. Palmer <rebecca_palmer@zoho.com>
Tue, 28 Jan 2020 22:29:29 +0000 (22:29 +0000)
Avoids a fail due to mismatched extension .so version
when multiple Python 3 versions are available

Author: Rebecca N. Palmer <rebecca_palmer@zoho.com>
Forwarded: no

Gbp-Pq: Name subprocess_use_same_pyver.patch

statsmodels/tests/test_package.py

index 74dd51974aca01d715d4e624582c09e6c87b285f..694300e4660a3f6d7a886b2f160380da4679b7cf 100644 (file)
@@ -15,7 +15,8 @@ def test_lazy_imports():
            "assert not mods, mods")
 
     # TODO: is there a cleaner way to do this import in an isolated environment
-    pyexe = 'python3' if PY3 else 'python'
+    import sys
+    pyexe = sys.executable or 'python3'
     p = subprocess.Popen(pyexe + ' -c "' + cmd + '"',
                          shell=True, close_fds=True)
     p.wait()