Since upgrading from Python 2.7 to 3.6, I am seeing the following deprecation warning about the imp module:
DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses
This warning is somewhat annoying and I'd like to get rid of it, however I haven't been able to replace the plugin system with importlib.
The closest I've got so far is [1]:
import importlib
module_spec = importlib.machinery.PathFinder().find_spec(addon, [PLUGIN_DIRECTORY])
module = importlib.util.module_from_spec(module_spec)
module_spec.loader.exec_module(module)
But that doesn't work:
*** ModuleNotFoundError: No module named 'my_addon'
It would be nice to have an updated version of the framework that works with importlib.