add os.path.abspath() in dirname generation of the reloader

Otherwise adding a watcher for a file located in the working directory generates an empty dirname, resulting in the following error:
inotify.calls.InotifyError: Call failed (should not be -1): (-1) ERRNO=(0)

Caused by the fact that we call inotify with an empty path
This commit is contained in:
Mikaël Dusenne 2019-12-30 08:39:03 -05:00
parent cfc93ad701
commit e5310d15e9

View File

@ -92,7 +92,7 @@ if has_inotify:
def get_dirs(self):
fnames = [
os.path.dirname(COMPILED_EXT_RE.sub('py', module.__file__))
os.path.dirname(os.path.abspath(COMPILED_EXT_RE.sub('py', module.__file__)))
for module in tuple(sys.modules.values())
if getattr(module, '__file__', None)
]