summaryrefslogtreecommitdiff
path: root/numpy/tests/test_scripts.py
diff options
context:
space:
mode:
authorgfyoung <gfyoung17@gmail.com>2016-02-02 19:34:38 +0000
committergfyoung <gfyoung17@gmail.com>2016-02-02 20:39:26 +0000
commit69a2ca41e2316e0eaa11ac2b9a618926815dad6d (patch)
treebfc1fc4aafe10fcf1f88c5e104651875afc63d52 /numpy/tests/test_scripts.py
parent58c51b0fc22cd3665d7456064647bf73303d60c0 (diff)
downloadnumpy-69a2ca41e2316e0eaa11ac2b9a618926815dad6d.tar.gz
TST: Fixed f2py test for Anaconda non-win32
When you run 'python -V' under Anaconda, it returns for example, 'Python 3.4.3 :: Continuum Analytics, Inc.' However, the original parsing of the version in 'test_f2py' assumed there was nothing following the version number, causing a ValueError because you can't assign three variables to four components that you get from splitting on the '.'
Diffstat (limited to 'numpy/tests/test_scripts.py')
-rw-r--r--numpy/tests/test_scripts.py11
1 files changed, 3 insertions, 8 deletions
diff --git a/numpy/tests/test_scripts.py b/numpy/tests/test_scripts.py
index 0fc7f879f..1c108ddb1 100644
--- a/numpy/tests/test_scripts.py
+++ b/numpy/tests/test_scripts.py
@@ -74,14 +74,9 @@ def test_f2py():
success = stdout.strip() == asbytes('2')
assert_(success, "Warning: f2py not found in path")
else:
- # unclear what f2py cmd was installed as, check plain (f2py),
- # with major version (f2py3), or major/minor version (f2py3.4)
- code, stdout, stderr = run_command([sys.executable, '-V'])
-
- # for some reason, 'python -V' returns version in 'stderr' for
- # Python 2.x but in 'stdout' for Python 3.x
- version = (stdout or stderr)[7:].strip()
- major, minor, revision = version.decode('utf-8').split('.')
+ version = sys.version_info
+ major = str(version.major)
+ minor = str(version.minor)
f2py_cmds = ('f2py', 'f2py' + major, 'f2py' + major + '.' + minor)
success = False