SofaPython3
SofaPython3 copied to clipboard
Replace deprecated imp by importlib
https://docs.python.org/dev/whatsnew/3.12.html#imp
Imp has been deprecated since Python3 3.4 (!) and has been removed in 3.12.1 Hitting first macOS users because homebrew recently updated their version.
More context : https://discuss.python.org/t/how-do-i-migrate-from-imp/27885/13
livecoding.py
is called in PythonEnvironment, so it is throwing an error every time.
This PR replaces imp by importlib.
I just tested by calling directly the file (and using the onReimpAFile(file). There is no test at all currently and this onReimpAFile() function is only used for prefab.
Fix partially https://github.com/sofa-framework/sofa/discussions/4624
@damienmarchal, @olivier-roussel, @hugtalbot can we merge this ? Thanks.
Yes