Skip to content

Replace deprecated imp by importlib#411

Merged
bakpaul merged 1 commit intosofa-framework:masterfrom
fredroy:use_importlib
May 8, 2024
Merged

Replace deprecated imp by importlib#411
bakpaul merged 1 commit intosofa-framework:masterfrom
fredroy:use_importlib

Conversation

@fredroy
Copy link
Copy Markdown
Contributor

@fredroy fredroy commented Apr 3, 2024

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 sofa-framework/sofa#4624

@adagolodjo
Copy link
Copy Markdown
Contributor

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

@damienmarchal
Copy link
Copy Markdown
Contributor

Yes

@bakpaul bakpaul merged commit 180913a into sofa-framework:master May 8, 2024
@fredroy fredroy deleted the use_importlib branch May 8, 2024 05:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants