From 394d5468349705630c3693e87cb317d55b342bcd Mon Sep 17 00:00:00 2001 From: zhangjian Date: Fri, 15 Sep 2017 20:49:52 +0800 Subject: [PATCH] Output friendly and concise message when updating pipenv failed. --- pipenv/cli.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pipenv/cli.py b/pipenv/cli.py index 44ca34c6..7a739270 100644 --- a/pipenv/cli.py +++ b/pipenv/cli.py @@ -140,7 +140,11 @@ def check_for_updates(): def ensure_latest_self(user=False): """Updates Pipenv to latest version, cleverly.""" - r = requests.get('https://pypi.python.org/pypi/pipenv/json', timeout=0.5) + try: + r = requests.get('https://pypi.python.org/pypi/pipenv/json', timeout=0.5) + except requests.RequestException as e: + click.echo(crayons.red(e)) + sys.exit(1) latest = sorted([semver.parse_version_info(v) for v in list(r.json()['releases'].keys())])[-1] current = semver.parse_version_info(__version__)