reload fix - don't reload files with no pyc

This commit is contained in:
Luke Campagnola 2020-07-17 09:54:51 +03:00
parent 31b0ddcee6
commit 7eb2bf6306

View File

@ -78,8 +78,11 @@ def reloadAll(prefix=None, debug=False):
# if source file is newer than cache file, then it needs to be reloaded.
pyc = getattr(mod, '__cached__', py + 'c')
if os.path.isfile(pyc) and os.stat(pyc).st_mtime < os.stat(py).st_mtime:
if not os.path.isfile(pyc):
ret[modName] = (False, 'code has no pyc file to compare')
continue
if os.stat(pyc).st_mtime > os.stat(py).st_mtime:
ret[modName] = (False, 'code has not changed since compile')
continue