From b87fca27261f79be20ab06a222ed2330d60d9f2c Mon Sep 17 00:00:00 2001 From: Eric Wieser Date: Sat, 25 Mar 2017 10:11:43 +0000 Subject: 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. --- numpy/lib/tests/test__datasource.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'numpy/lib/tests/test__datasource.py') diff --git a/numpy/lib/tests/test__datasource.py b/numpy/lib/tests/test__datasource.py index f4bece352..f2ad0344a 100644 --- a/numpy/lib/tests/test__datasource.py +++ b/numpy/lib/tests/test__datasource.py @@ -5,7 +5,6 @@ import sys from tempfile import mkdtemp, mkstemp, NamedTemporaryFile from shutil import rmtree -from numpy.compat import asbytes from numpy.testing import ( run_module_suite, TestCase, assert_, SkipTest ) @@ -53,7 +52,7 @@ http_fakefile = 'fake.txt' malicious_files = ['/etc/shadow', '../../shadow', '..\\system.dat', 'c:\\windows\\system.dat'] -magic_line = asbytes('three is the magic number') +magic_line = b'three is the magic number' # Utility functions used by many TestCases -- cgit v1.2.1