Skip to content

Port from imp to importlib (imp is removed in Python 3.12)

Adam Williamson requested to merge adamw/orca:no-imp into master

imp is removed in Python 3.12, so we need to port to importlib. The use of imp.reload() is a straight swap, easy. Loading a module from a custom path is trickier now though (if you don't want to just stuff it on sys.path temporarily, I guess). This is based on Miro Hroncok's approach at https://discuss.python.org/t/how-do-i-migrate-from-imp/27885/3 .

Signed-off-by: Adam Williamson awilliam@redhat.com

Merge request reports