Commit 00e86b85 authored by Julien Muchembled's avatar Julien Muchembled

fixup! fixup! download: clean-up, fix, optimization

Commit c3903c7e was error-prone
because (lambda f1, f2: False) may be wrong in other cases than where
it's currently used.
parent e8a56bd0
......@@ -40,10 +40,6 @@ import re
import shutil
import tempfile
import zc.buildout
try:
from os.path import samefile
except ImportError:
samefile = lambda f1, f2: False
from . import bytes2str, str2bytes
from .rmtree import rmtree
......@@ -166,7 +162,8 @@ class Download(object):
self.logger.debug("Fallback to cache using %s",
cached_path, exception=1)
else:
if not samefile(path, cached_path):
samefile = getattr(os.path, 'samefile', None)
if not (samefile and samefile(path, cached_path)):
# update cache
try:
os.remove(cached_path)
......
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