From b719cc003379819e2dd1b77303b019d5e5580882 Mon Sep 17 00:00:00 2001 From: Chris Hunt Date: Mon, 2 Sep 2019 19:36:57 -0400 Subject: [PATCH] Fix indentation: fix indentation --- src/pip/_internal/operations/prepare.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/pip/_internal/operations/prepare.py b/src/pip/_internal/operations/prepare.py index dfafcc39d..858341199 100644 --- a/src/pip/_internal/operations/prepare.py +++ b/src/pip/_internal/operations/prepare.py @@ -100,16 +100,16 @@ class RequirementPreparer(object): @property def _download_should_save(self): # type: () -> bool - # TODO: Modify to reduce indentation needed - if self.download_dir: - if os.path.exists(self.download_dir): - return True - else: - logger.critical('Could not find download directory') - raise InstallationError( - "Could not find or access download directory '%s'" - % display_path(self.download_dir)) - return False + if not self.download_dir: + return False + + if os.path.exists(self.download_dir): + return True + + logger.critical('Could not find download directory') + raise InstallationError( + "Could not find or access download directory '%s'" + % display_path(self.download_dir)) def prepare_linked_requirement( self,