From f741059e2e3d7bbbde08d214bea1912dfd8f9a41 Mon Sep 17 00:00:00 2001 From: Matt Date: Fri, 11 May 2018 11:26:50 -0700 Subject: [PATCH 1/2] Make sure we are not in a virtualenv if aborting --- pipenv/core.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pipenv/core.py b/pipenv/core.py index 4d1b559da8..625ef78478 100644 --- a/pipenv/core.py +++ b/pipenv/core.py @@ -1346,7 +1346,7 @@ def do_init( do_lock(system=system, pre=pre, keep_outdated=keep_outdated) # Write out the lockfile if it doesn't exist. if not project.lockfile_exists and not skip_lock: - if system or allow_global and not PIPENV_VIRTUALENV: + if (system or allow_global) and not PIPENV_VIRTUALENV: click.echo( '{0}: --system is intended to be used for Pipfile installation, ' 'not installation of specific packages. Aborting.'.format( From 9738b4224116ea1c2499d7a09b931ea2d768e855 Mon Sep 17 00:00:00 2001 From: Matt Date: Sat, 12 May 2018 12:00:44 -0700 Subject: [PATCH 2/2] Add a comment describing the conditional --- pipenv/core.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pipenv/core.py b/pipenv/core.py index 625ef78478..8c29cb2fe8 100644 --- a/pipenv/core.py +++ b/pipenv/core.py @@ -1346,6 +1346,8 @@ def do_init( do_lock(system=system, pre=pre, keep_outdated=keep_outdated) # Write out the lockfile if it doesn't exist. if not project.lockfile_exists and not skip_lock: + # Unless we're in a virtualenv not managed by pipenv, abort if we're + # using the system's python. if (system or allow_global) and not PIPENV_VIRTUALENV: click.echo( '{0}: --system is intended to be used for Pipfile installation, '