mirror of
https://github.com/pypa/pip
synced 2023-12-13 21:30:23 +01:00
Fix unassigned variable.
In the event of an error, 'req' will be unassigned. This will cause another error in the exception. Replace 'req' with 'name.'
This commit is contained in:
parent
fc6b2c1920
commit
ce674d2ca1
2 changed files with 3 additions and 1 deletions
2
news/4811.bugfix
Normal file
2
news/4811.bugfix
Normal file
|
@ -0,0 +1,2 @@
|
|||
Fix an issue where a variable assigned in a try clause was accessed in the except clause, resulting in an undefined
|
||||
variable error in the except clause.
|
|
@ -139,7 +139,7 @@ class InstallRequirement(object):
|
|||
try:
|
||||
req = Requirement(name)
|
||||
except InvalidRequirement:
|
||||
raise InstallationError("Invalid requirement: '%s'" % req)
|
||||
raise InstallationError("Invalid requirement: '%s'" % name)
|
||||
else:
|
||||
req = None
|
||||
return cls(
|
||||
|
|
Loading…
Reference in a new issue