nose
nose copied to clipboard
Replace uses of imp.find_module / imp.load_module with importlib in the importer
As of 3.3, these functions are deprecated in favor of importlib implementations, which also happen to properly respect path hooks.
This is interfering with a thing I'm writing, so if I get a moment hopefully a pull request will be incoming (without breaking backwards compat obviously).
Bumping this, as this is the only warning in my project when running in python -Wd mode under python 3.6.3.
Warning looks like this:
lib/python3.6/site-packages/nose/importer.py:12: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses
from imp import find_module, load_module, acquire_lock, release_lock
I am currently working on this. Luckily find_module() and load_module() have a replacement. acquire_lock() and release_lock() however don't. We could use threading instead?
Has there been any progress on this? Do we still need the acquire_lock calls given importlib does locking internally? If the locks are just being used to guard local state, then using the threading module seems like the better strategy.
This has been fixed in https://github.com/mdmintz/pynose/releases/tag/v1.4.3 using the code from @chugcup (https://github.com/chugcup/nose/commit/67654c89b17a302763f57feea0abc4fba3ad2322).
pynose in the new maintained nose.
https://github.com/mdmintz/pynose --- https://pypi.org/project/pynose/