Merge pull request #3277 from maiksensi/bug/3241-check-if-dir-exists

Use `isdir` instead of `exists`
This commit is contained in:
Bruno Oliveira 2018-03-04 10:49:25 -03:00 committed by GitHub
commit e980fbbe39
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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
checking for the existence of the appropriate activate script"""
bindir = path.join('Scripts' if sys.platform.startswith('win') else 'bin')
if not bindir.exists():
if not bindir.isdir():
return False
activates = ('activate', 'activate.csh', 'activate.fish',
'Activate', 'Activate.bat', 'Activate.ps1')

View File

@ -0,0 +1,2 @@
Refactor check of bindir from ``exists`` to ``isdir`` regarding `#3241 <https://github.com/pytest-dev/pytest/issues/3241>`_.