Commit c808bec0 authored by Robert Bradshaw's avatar Robert Bradshaw

Write cycache files atomically.

This fixes #1393.
parent 5bd3fd90
......@@ -1149,11 +1149,12 @@ def cythonize_one(pyx_file, c_file, fingerprint, quiet, options=None,
elif fingerprint:
f = open(c_file, 'rb')
try:
g = gzip_open(fingerprint_file, 'wb')
g = gzip_open(fingerprint_file + '.tmp', 'wb')
try:
shutil.copyfileobj(f, g)
finally:
g.close()
os.rename(fingerprint_file + '.tmp', fingerprint_file)
finally:
f.close()
......
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