diff options
author | Sybren A. Stüvel <sybren@blender.org> | 2021-03-26 12:46:26 +0300 |
---|---|---|
committer | Sybren A. Stüvel <sybren@blender.org> | 2021-03-26 12:46:26 +0300 |
commit | d982ea9a9e449c1cb57d249cf7301956ae333930 (patch) | |
tree | 0a2ad7cfcffd0e3ab848e21d68be45bc6aeff675 /intern | |
parent | fda50625cd099b4e65b5e82c7c9a48af256b45fd (diff) |
Fix error when an addon has no `__init__.py`
When an addon has been removed, but its `.pyc` files are still there,
the Python module can still be loaded. However, because `__init__.py` is
missing, it becomes a namespace instead of a module, and its `__file__`
will be set to `None`. As a result, it's impossible to get the mtime
from the file (because there is none).
This should not influence any regularly uninstalled add-on, as that
would just remove the add-on's directory; I ran into the problem when
switching Git branches caused an add-on's Python files to disappear
while keeping the `__pycache__` directory around.
Diffstat (limited to 'intern')
0 files changed, 0 insertions, 0 deletions