Fix missing import of ConnectionError

- Update exception handler for uninstaller to convert set to str

Signed-off-by: Dan Ryan <dan@danryan.co>
This commit is contained in:
Dan Ryan
2019-02-18 13:50:04 -05:00
parent fae1dbab64
commit adaf4427fd
2 changed files with 4 additions and 3 deletions
+3 -3
View File
@@ -232,12 +232,12 @@ class VirtualenvCreationException(VirtualenvException):
class UninstallError(PipenvException):
def __init__(self, package, command, return_values, return_code, **kwargs):
extra = [crayons.blue("Attempted to run command: {0}".format(
crayons.yellow("$ {0}".format(command), bold=True)
crayons.yellow("$ {0!r}".format(command), bold=True)
)),]
extra.extend([crayons.blue(line.strip()) for line in return_values.splitlines()])
if isinstance(package, (tuple, list)):
if isinstance(package, (tuple, set, list)):
package = " ".join(package)
message = "{0} {1}...".format(
message = "{0!s} {1!s}...".format(
crayons.normal("Failed to uninstall package(s)"),
crayons.yellow(package, bold=True)
)
+1
View File
@@ -552,6 +552,7 @@ class Resolver(object):
return cleaned_checksums
def collect_hashes(self, ireq):
from requests import ConnectionError
collected_hashes = []
if ireq in self.hashes:
collected_hashes += list(self.hashes.get(ireq, []))