Skip to content

Replace deprecated pkgutil.find_loader with importlib.util.find_spec#31

Open
someone42 wants to merge 1 commit intoabobija:mainfrom
someone42:main
Open

Replace deprecated pkgutil.find_loader with importlib.util.find_spec#31
someone42 wants to merge 1 commit intoabobija:mainfrom
someone42:main

Conversation

@someone42
Copy link
Copy Markdown

pkgutil.find_loader was deprecated in Python 3.12. At the moment Python just emits a warning, but in Python 3.14, pkgutil.find_loader will be removed. This PR replaces pkgutil.find_loader with the recommended substitute importlib.util.find_spec.

This will break idfx on installations that have Python <= 3.4. I don't think this will be a problem, given that the latest version of esptool requires Python >= 3.7. But I can imagine there might be migrated installations out there using old versions of Python and esptool, so here's something for the search engines:

If you're getting ModuleNotFoundError: No module named 'importlib.util' or AttributeError: module 'importlib.util' has no attribute 'find_spec' when running idfx, your Windows-side (i.e. not within WSL2) Python installation is too old. Upgrade it to Python >= 3.4.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant