Commit 14c1d8df authored by Robert Bradshaw's avatar Robert Bradshaw

Fix Python 3 issues.

parent 886b9e8d
......@@ -1157,9 +1157,9 @@ def cythonize_one(pyx_file, c_file, fingerprint, quiet, options=None,
elif os.path.exists(c_file):
os.remove(c_file)
elif fingerprint:
artifacts = filter(None, [
artifacts = list(filter(None, [
getattr(result, attr, None)
for attr in ('c_file', 'h_file', 'api_file', 'i_file')])
for attr in ('c_file', 'h_file', 'api_file', 'i_file')]))
if len(artifacts) == 1:
fingerprint_file = gz_fingerprint_file
with open(c_file, 'rb') as f:
......
......@@ -58,7 +58,7 @@ class TestInline(CythonTest):
open(a_pyx, 'w').write('pass')
self.fresh_cythonize(a_pyx, cache=self.cache_dir)
a_cache = os.path.join(self.cache_dir, os.listdir(self.cache_dir)[0])
gzip.GzipFile(a_cache, 'wb').write('fake stuff')
gzip.GzipFile(a_cache, 'wb').write('fake stuff'.encode('ascii'))
os.unlink(a_c)
self.fresh_cythonize(a_pyx, cache=self.cache_dir)
a_contents = open(a_c).read()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment