Use truthiness of everything but None for use_user_site

This commit is contained in:
Thomas Kluyver 2019-10-25 08:26:11 +01:00
parent 17e9f4c4a3
commit 1310fc276a
1 changed files with 3 additions and 3 deletions

View File

@ -617,12 +617,12 @@ def decide_user_install(
which is provided by the other arguments.
"""
# 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
# rather than a bool, which 'use_user_site is False' wouldn't catch.
if (use_user_site is not None) and (not use_user_site):
logger.debug("Non-user install by explicit request")
return False
if use_user_site == True: # noqa: E712
if use_user_site:
if prefix_path:
raise CommandError(
"Can not combine '--user' and '--prefix' as they imply "