Skip to content

Commit

Permalink
Merge pull request #2181 from pegler/bugfix/2078a-allow-locking-in-vi…
Browse files Browse the repository at this point in the history
…rtualenv

Make sure we are not in a virtualenv if aborting
  • Loading branch information
techalchemy authored May 15, 2018
2 parents da5a8b3 + 0d958da commit d1957f1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pipenv/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -1346,7 +1346,9 @@ 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:
# 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, '
'not installation of specific packages. Aborting.'.format(
Expand Down

0 comments on commit d1957f1

Please sign in to comment.