SofaPython3 icon indicating copy to clipboard operation
SofaPython3 copied to clipboard

Replace deprecated imp by importlib

Open fredroy opened this issue 3 months ago • 2 comments

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

fredroy avatar Apr 03 '24 23:04 fredroy

@damienmarchal, @olivier-roussel, @hugtalbot can we merge this ? Thanks.

adagolodjo avatar Apr 04 '24 04:04 adagolodjo

Yes

damienmarchal avatar Apr 08 '24 08:04 damienmarchal