From 7eb2bf630666431168bdbbb5b730d3e317a3cdc4 Mon Sep 17 00:00:00 2001 From: Luke Campagnola Date: Fri, 17 Jul 2020 09:54:51 +0300 Subject: [PATCH] reload fix - don't reload files with no pyc --- pyqtgraph/reload.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pyqtgraph/reload.py b/pyqtgraph/reload.py index 7a6e9865..05ef8f0f 100644 --- a/pyqtgraph/reload.py +++ b/pyqtgraph/reload.py @@ -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