fpom / snakes

SNAKES is the Net Algebra Kit for Editors and Simulators
https://snakes.ibisc.univ-evry.fr
Other
88 stars 29 forks source link

imp library obsolete, to be replaced by importlib #32

Closed g-gg closed 4 months ago

g-gg commented 4 months ago

Dear Mr Pommereau and all other contributors, thank you for creating and maintaining this library. I stumbled across fundamental problems with python 3.12:

import snakes.plugins fails with

Exception has occurred: ModuleNotFoundError No module named 'imp'

Indeed the imp library has been marked as obsolete. Quoting from the python 3.10 documentation on the imp library: Deprecated since version 3.4: The imp module is deprecated in favor of importlib.

It seems to me that for the call imp.new_module in the function build() in plugins/init.py there is no direct equivalent in the importlib function, so this could be a starting point. Disclaimer: I've never used neither of the libraries.

Thank you

fpom commented 4 months ago

Hi, Thank you for your report. This should be fixed in the latest commit. Franck

g-gg commented 4 months ago

thank you for resolving this so promptly, I confirm that the issue is solved now with the latest commit.