Skip to content

Commit

Permalink
Fix FileNotFoundError in persistent mode. Fixes #68.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaraco committed Jan 22, 2023
1 parent 468ef7b commit d39f622
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
5 changes: 5 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
v10.0.4
=======

#68: Fixed ``FileNotFoundError`` in persistent mode.

v10.0.3
=======

Expand Down
7 changes: 6 additions & 1 deletion pip_run/deps.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,11 @@ def mode():
return importlib.import_module(f'.mode.{mode}', package=__package__)


@suppress(FileNotFoundError)
def contents(path):
return list(path.iterdir())


def empty(path):
"""
>>> target = getfixture('tmp_path')
Expand All @@ -73,7 +78,7 @@ def empty(path):
>>> empty(target / 'missing')
True
"""
return not bool(list(path.iterdir()))
return not bool(contents(path))


@contextlib.contextmanager
Expand Down

0 comments on commit d39f622

Please sign in to comment.