From adaf4427fd84887dec913e8a5322f97b7ef3fae6 Mon Sep 17 00:00:00 2001 From: Dan Ryan Date: Mon, 18 Feb 2019 13:50:04 -0500 Subject: [PATCH] Fix missing import of `ConnectionError` - Update exception handler for uninstaller to convert set to str Signed-off-by: Dan Ryan --- pipenv/exceptions.py | 6 +++--- pipenv/utils.py | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/pipenv/exceptions.py b/pipenv/exceptions.py index 80e3735b..a055f8a5 100644 --- a/pipenv/exceptions.py +++ b/pipenv/exceptions.py @@ -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) ) diff --git a/pipenv/utils.py b/pipenv/utils.py index ba33da0f..d31ba843 100644 --- a/pipenv/utils.py +++ b/pipenv/utils.py @@ -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, []))