Skip to content

Commit

Permalink
Set data_dirs closer to first use
Browse files Browse the repository at this point in the history
Reducing the scope of variables reduces possible dependencies between
parts of this function, and will make it easier to extract this section
into its own function.
  • Loading branch information
chrahunt committed Jul 3, 2020
1 parent 01e0d8b commit abed1d6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/pip/_internal/operations/install/wheel.py
Original file line number Diff line number Diff line change
Expand Up @@ -366,10 +366,6 @@ def install_unpacked_wheel(
else:
lib_dir = scheme.platlib

# Zip file path separators must be /
subdirs = set(p.split("/", 1)[0] for p in wheel_zip.namelist())
data_dirs = [s for s in subdirs if s.endswith('.data')]

# Record details of the files moved
# installed = files copied from the wheel to the destination
# changed = files changed while installing (scripts #! line typically)
Expand Down Expand Up @@ -486,6 +482,10 @@ def is_entrypoint_wrapper(name):
# Ignore setuptools-generated scripts
return (matchname in console or matchname in gui)

# Zip file path separators must be /
subdirs = set(p.split("/", 1)[0] for p in wheel_zip.namelist())
data_dirs = [s for s in subdirs if s.endswith('.data')]

for datadir in data_dirs:
fixer = None
filter = None
Expand Down

0 comments on commit abed1d6

Please sign in to comment.