Merge pull request #901 from ksunden/reload

Add condition for namespace packages
This commit is contained in:
Ogi Moore 2019-06-04 10:01:57 -07:00 committed by GitHub
commit 2552be986f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -47,7 +47,7 @@ def reloadAll(prefix=None, debug=False):
continue
## Ignore if the file name does not start with prefix
if not hasattr(mod, '__file__') or os.path.splitext(mod.__file__)[1] not in ['.py', '.pyc']:
if not hasattr(mod, '__file__') or mod.__file__ is None or os.path.splitext(mod.__file__)[1] not in ['.py', '.pyc']:
continue
if prefix is not None and mod.__file__[:len(prefix)] != prefix:
continue