Skip to content

Commit

Permalink
Allow for use_user_site being set to an integer
Browse files Browse the repository at this point in the history
This can come from tox config, see:
pypa#7002 (comment)
  • Loading branch information
takluyver committed Oct 24, 2019
1 parent c729a84 commit d631a93
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/pip/_internal/commands/install.py
Original file line number Diff line number Diff line change
Expand Up @@ -616,11 +616,13 @@ def decide_user_install(
If use_user_site is None, the default behaviour depends on the environment,
which is provided by the other arguments.
"""
if use_user_site is False:
# In some cases (config from tox), use_user_site can be set to an integer
# rather than a bool. Comparing == True/False instead of 'is' allows this.
if use_user_site == False: # noqa: E712
logger.debug("Non-user install by explicit request")
return False

if use_user_site is True:
if use_user_site == True: # noqa: E712
if prefix_path:
raise CommandError(
"Can not combine '--user' and '--prefix' as they imply "
Expand Down

0 comments on commit d631a93

Please sign in to comment.