move directory creation below the file filtering

This commit is contained in:
Marcus Smith 2014-04-22 16:09:04 -07:00
parent e1e02ac002
commit b542c9906b
1 changed files with 4 additions and 2 deletions

View File

@ -192,14 +192,16 @@ def move_wheel_files(name, req, wheeldir, user=False, home=None, root=None,
and s.lower().startswith(req.project_name.replace('-', '_').lower())):
assert not info_dir, 'Multiple .dist-info directories'
info_dir.append(destsubdir)
if files and not os.path.exists(destdir):
os.makedirs(destdir)
for f in files:
# Skip unwanted files
if filter and filter(f):
continue
srcfile = os.path.join(dir, f)
destfile = os.path.join(dest, basedir, f)
# directory creation is lazy and after the file filtering above
# to ensure we don't install empty dirs
if not os.path.exists(destdir):
os.makedirs(destdir)
shutil.move(srcfile, destfile)
changed = False
if fixer: