Use .is_file in place of .exists

This commit is contained in:
Zach Snicker 2024-06-28 22:43:29 +05:30
parent 3c64f1110c
commit eab0eb34d2
1 changed files with 1 additions and 1 deletions

View File

@ -371,7 +371,7 @@ def _in_venv(path: Path) -> bool:
"""Attempt to detect if ``path`` is the root of a Virtual Environment by
checking for the existence of the pyvenv.cfg file."""
try:
return path.joinpath("pyvenv.cfg").exists()
return path.joinpath("pyvenv.cfg").is_file()
except OSError:
return False