Use `isdir` instead of `exists`

This commit is contained in:
Maik Figura 2018-03-04 00:55:04 +01:00
parent 3b757b1b8c
commit 056d9e8dc2
No known key found for this signature in database
GPG Key ID: D1C49B744B15919A
2 changed files with 3 additions and 1 deletions

View File

@ -170,7 +170,7 @@ def _in_venv(path):
"""Attempts to detect if ``path`` is the root of a Virtual Environment by """Attempts to detect if ``path`` is the root of a Virtual Environment by
checking for the existence of the appropriate activate script""" checking for the existence of the appropriate activate script"""
bindir = path.join('Scripts' if sys.platform.startswith('win') else 'bin') bindir = path.join('Scripts' if sys.platform.startswith('win') else 'bin')
if not bindir.exists(): if not bindir.isdir():
return False return False
activates = ('activate', 'activate.csh', 'activate.fish', activates = ('activate', 'activate.csh', 'activate.fish',
'Activate', 'Activate.bat', 'Activate.ps1') 'Activate', 'Activate.bat', 'Activate.ps1')

View File

@ -0,0 +1,2 @@
Refactor check of bindir from `exists` to `isdir`.