It seems having "imp" is still working in python 3.10 but not 3.12+
The solution is looking simple, we should change "imp" to "importlib", but in fact more changes are necessary.
one thing, in globals().update() we should add , __spec__=... (I believe __spec__=None). Also, this is not enough, module import is no longer working. It seems InlinerImporter.find_module() should be changed to something, maybe InlinerImporter.find_spec(). It needs diving deeper into it. The current config is not working with moduleimporter.