Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Avoid double-calling find_requirement for the same requirement.

  • Loading branch information...
commit 417013226bc80b092fc0e4d9a3fd90618266cc3f 1 parent b9ef317
@carljm carljm authored
Showing with 6 additions and 6 deletions.
  1. +6 −6 pip/req.py
View
12 pip/req.py
@@ -912,16 +912,16 @@ def prepare_files(self, finder, force_root_egg_info=False, bundle=False):
if self.upgrade:
if not self.force_reinstall:
try:
- finder.find_requirement(req_to_install,
- self.uninstall)
+ url = finder.find_requirement(
+ req_to_install, self.upgrade)
except BestVersionAlreadyInstalled:
best_installed = True
install = False
- except:
- # Ignore DistributionNotFound for now
- pass
+ else:
+ # Avoid the need to call find_requirement again
+ req_to_install.url = url.url
- if self.force_reinstall or not best_installed:
+ if not best_installed:
req_to_install.conflicts_with = req_to_install.satisfied_by
req_to_install.satisfied_by = None
else:
Please sign in to comment.
Something went wrong with that request. Please try again.