mirror of
https://github.com/kennethreitz/pipenv.git
synced 2026-06-05 22:50:18 +00:00
catch attribute error
fixes #525 Signed-off-by: Kenneth Reitz <me@kennethreitz.org>
This commit is contained in:
+11
-9
@@ -151,18 +151,20 @@ def ensure_latest_pip():
|
||||
"""Updates pip to the latest version."""
|
||||
|
||||
# Ensure that pip is installed.
|
||||
c = delegator.run('"{0}" install pip'.format(which_pip()))
|
||||
try:
|
||||
c = delegator.run('"{0}" install pip'.format(which_pip()))
|
||||
|
||||
# Check if version is out of date.
|
||||
if 'however' in c.err:
|
||||
# If version is out of date, update.
|
||||
click.echo(crayons.yellow(u'Pip is out of date… updating to latest.'))
|
||||
# Check if version is out of date.
|
||||
if 'however' in c.err:
|
||||
# If version is out of date, update.
|
||||
click.echo(crayons.yellow(u'Pip is out of date… updating to latest.'))
|
||||
|
||||
windows = '-m' if os.name == 'nt' else ''
|
||||
|
||||
c = delegator.run('"{0}" install {1} pip --upgrade'.format(which_pip()), windows, block=False)
|
||||
click.echo(crayons.blue(c.out))
|
||||
windows = '-m' if os.name == 'nt' else ''
|
||||
|
||||
c = delegator.run('"{0}" install {1} pip --upgrade'.format(which_pip()), windows, block=False)
|
||||
click.echo(crayons.blue(c.out))
|
||||
except AttributeError:
|
||||
pass
|
||||
|
||||
def import_requirements(r=None):
|
||||
# Parse requirements.txt file with Pip's parser.
|
||||
|
||||
Reference in New Issue
Block a user