diff options
author | Eric Wieser <wieser.eric@gmail.com> | 2017-03-25 10:11:43 +0000 |
---|---|---|
committer | Eric Wieser <wieser.eric@gmail.com> | 2017-03-25 10:36:28 +0000 |
commit | b87fca27261f79be20ab06a222ed2330d60d9f2c (patch) | |
tree | 00907ad5fffa7d13f99b1cf60398c624063f807e /numpy/tests/test_scripts.py | |
parent | a2c4d3230d58a5c4569ab2c7f13bdf9499b71dd4 (diff) | |
download | numpy-b87fca27261f79be20ab06a222ed2330d60d9f2c.tar.gz |
MAINT: Remove asbytes where a b prefix would suffice
Since we only need to support python 2, we can remove any case where we just
pass a single string literal and use the b prefix instead.
What we can't do is transform asbytes("tests %d" % num), because %-formatting
fails on bytes in python 3.x < 3.5.
Diffstat (limited to 'numpy/tests/test_scripts.py')
-rw-r--r-- | numpy/tests/test_scripts.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/numpy/tests/test_scripts.py b/numpy/tests/test_scripts.py index bd7d06c95..489e0c6e5 100644 --- a/numpy/tests/test_scripts.py +++ b/numpy/tests/test_scripts.py @@ -9,7 +9,7 @@ from os.path import join as pathjoin, isfile, dirname, basename import sys from subprocess import Popen, PIPE import numpy as np -from numpy.compat.py3k import basestring, asbytes +from numpy.compat.py3k import basestring from nose.tools import assert_equal from numpy.testing.decorators import skipif from numpy.testing import assert_ @@ -71,7 +71,7 @@ def test_f2py(): f2py_cmd = r"%s\Scripts\f2py.py" % exe_dir code, stdout, stderr = run_command([sys.executable, f2py_cmd, '-v']) - success = stdout.strip() == asbytes('2') + success = stdout.strip() == b'2' assert_(success, "Warning: f2py not found in path") else: version = sys.version_info @@ -84,7 +84,7 @@ def test_f2py(): for f2py_cmd in f2py_cmds: try: code, stdout, stderr = run_command([f2py_cmd, '-v']) - assert_equal(stdout.strip(), asbytes('2')) + assert_equal(stdout.strip(), b'2') success = True break except: |