Move dest_info_dir construction closer to first use

Reducing the scope of variables makes it easier to refactor, since
we can extract whole contiguous chunks of code later.
This commit is contained in:
Chris Hunt 2020-07-03 10:50:31 -04:00
parent 3930e4b063
commit 0433200135
1 changed files with 2 additions and 2 deletions

View File

@ -452,8 +452,6 @@ def install_unpacked_wheel(
True,
)
dest_info_dir = os.path.join(lib_dir, info_dir)
# Get the defined entry points
distribution = pkg_resources_distribution_for_wheel(
wheel_zip, name, wheel_path
@ -624,6 +622,8 @@ def install_unpacked_wheel(
os.chmod(f.name, generated_file_mode)
replace(f.name, path)
dest_info_dir = os.path.join(lib_dir, info_dir)
# Record pip as the installer
installer_path = os.path.join(dest_info_dir, 'INSTALLER')
with _generate_file(installer_path) as installer_file: