Skip to content

Commit df33f93

Browse files
committed
Fix crash when assets directory doesn't exist
The watchfiles library (Rust notify) crashes when watching a non-existent directory. Add existence check for app/assets before yielding it from _iter_asset_dirs().
1 parent 59a08f7 commit df33f93

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

plain/plain/assets/finders.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,4 +54,5 @@ def _iter_asset_dirs() -> Iterator[str]:
5454
yield asset_dir
5555

5656
# The app/assets take priority over everything
57-
yield _APP_ASSETS_DIR
57+
if _APP_ASSETS_DIR.exists():
58+
yield _APP_ASSETS_DIR

0 commit comments

Comments
 (0)