Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions idfx
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ idfx_check_esptool() {
return $IDFX_FAIL
fi

if [[ $(python.exe -c 'import pkgutil; print(1 if pkgutil.find_loader("esptool") else 0)') != '1'* ]]; then
if [[ $(python.exe -c 'import importlib.util; print(1 if importlib.util.find_spec("esptool") else 0)') != '1'* ]]; then
idfx_err 'Python package "esptool" needs to be installed on the Windows.'
read -p 'Would you like to install it now (y/n): ' answer

Expand Down Expand Up @@ -143,7 +143,7 @@ idfx_check_esp_idf_monitor() {
return $IDFX_FAIL
fi

if [[ $(python.exe -c 'import pkgutil; print(1 if pkgutil.find_loader("esp_idf_monitor") else 0)') != '1'* ]]; then
if [[ $(python.exe -c 'import importlib.util; print(1 if importlib.util.find_spec("esp_idf_monitor") else 0)') != '1'* ]]; then
idfx_err 'Python package "esp_idf_monitor" needs to be installed on the Windows.'
read -p 'Would you like to install it now (y/n): ' answer

Expand Down