diff options
Diffstat (limited to 'django/utils/autoreload.py')
| -rw-r--r-- | django/utils/autoreload.py | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/django/utils/autoreload.py b/django/utils/autoreload.py index 3153f3f14d..aa152343d6 100644 --- a/django/utils/autoreload.py +++ b/django/utils/autoreload.py @@ -235,8 +235,15 @@ class BaseReloader: def watch_dir(self, path, glob): path = Path(path) - if not path.is_absolute(): - raise ValueError('%s must be absolute.' % path) + try: + path = path.absolute() + except FileNotFoundError: + logger.debug( + 'Unable to watch directory %s as it cannot be resolved.', + path, + exc_info=True, + ) + return logger.debug('Watching dir %s with glob %s.', path, glob) self.directory_globs[path].add(glob) |
