summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcus Smith <qwcode@gmail.com>2014-04-22 16:09:04 -0700
committerMarcus Smith <qwcode@gmail.com>2014-04-22 16:09:04 -0700
commitb542c9906bfb8f700291ca6e16e10b7971a89dcb (patch)
tree04ac751b7951b4bfb98489db6bab7c1e9e1c02c3
parente1e02ac0025f243aff87cec2c590b214c1c32a7c (diff)
downloadpip-b542c9906bfb8f700291ca6e16e10b7971a89dcb.tar.gz
move directory creation below the file filtering
-rw-r--r--pip/wheel.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/pip/wheel.py b/pip/wheel.py
index 4e40657a2..82df2973f 100644
--- a/pip/wheel.py
+++ b/pip/wheel.py
@@ -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: