Skip to content

Commit

Permalink
Merge pull request #3277 from maiksensi/bug/3241-check-if-dir-exists
Browse files Browse the repository at this point in the history
Use `isdir` instead of `exists`
  • Loading branch information
nicoddemus committed Mar 4, 2018
2 parents 07e768a + 9a2e0c0 commit e980fbb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion _pytest/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down
2 changes: 2 additions & 0 deletions changelog/3241.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Refactor check of bindir from ``exists`` to ``isdir`` regarding `#3241 <https://github.com/pytest-dev/pytest/issues/3241>`_.

0 comments on commit e980fbb

Please sign in to comment.