Skip to content

Commit 1efaf48

Browse files
committed
Fixes for ruff rule PLW1508
1 parent a9d3a59 commit 1efaf48

File tree

2 files changed

+5
-8
lines changed

2 files changed

+5
-8
lines changed

pipenv/environments.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -425,15 +425,15 @@ def is_using_venv() -> bool:
425425
return result
426426

427427

428-
def is_in_virtualenv():
428+
def is_in_virtualenv() -> bool:
429429
"""
430430
Check virtualenv membership dynamically
431431
432-
:return: True or false depending on whether we are in a regular virtualenv or not
432+
:return: True or False depending on whether we are in a regular virtualenv or not
433433
:rtype: bool
434434
"""
435435

436-
pipenv_active = os.environ.get("PIPENV_ACTIVE", False)
436+
pipenv_active = os.environ.get("PIPENV_ACTIVE")
437437
virtual_env = bool(os.environ.get("VIRTUAL_ENV"))
438438
ignore_virtualenvs = bool(get_from_env("IGNORE_VIRTUALENVS"))
439439
return virtual_env and not (pipenv_active or ignore_virtualenvs)

pipenv/utils/pip.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -143,8 +143,5 @@ def get_pip_args(
143143
return list(dict.fromkeys(arg_set))
144144

145145

146-
def get_trusted_hosts():
147-
try:
148-
return os.environ.get("PIP_TRUSTED_HOSTS", []).split(" ")
149-
except AttributeError:
150-
return []
146+
def get_trusted_hosts() -> List[str]:
147+
return os.environ.get("PIP_TRUSTED_HOSTS", "").split()

0 commit comments

Comments
 (0)