Blender Git Loki

Git Commits -> Revision d982ea9

Revision d982ea9 by Sybren A. Stüvel (master)
March 26, 2021, 09:46 (GMT)
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.

Commit Details:

Full Hash: d982ea9a9e449c1cb57d249cf7301956ae333930
Parent Commit: fda5062
Lines Changed: +4, -0

1 Modified Path:

/release/scripts/modules/addon_utils.py (+4, -0) (Diff)
Tehnyt: Miika HämäläinenViimeksi päivitetty: 07.11.2014 14:18MiikaH:n Sivut a.k.a. MiikaHweb | 2003-2021