Merge pull request #901 from ksunden/reload
Add condition for namespace packages
This commit is contained in:
commit
2552be986f
@ -47,7 +47,7 @@ def reloadAll(prefix=None, debug=False):
|
|||||||
continue
|
continue
|
||||||
|
|
||||||
## Ignore if the file name does not start with prefix
|
## 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
|
continue
|
||||||
if prefix is not None and mod.__file__[:len(prefix)] != prefix:
|
if prefix is not None and mod.__file__[:len(prefix)] != prefix:
|
||||||
continue
|
continue
|
||||||
|
Loading…
Reference in New Issue
Block a user