Skip to content

Commit

Permalink
Replace deprecated pkgutil.find_loader use (#7906)
Browse files Browse the repository at this point in the history
### Description

Replace deprecated function with modern version

<string>:1: DeprecationWarning: 'pkgutil.find_loader' is deprecated and
slated for removal in Python 3.14; use importlib.util.find_spec()
instead


### Types of changes
- [x] Non-breaking change (fix or new feature that would not break
existing functionality).

Signed-off-by: Hans Johnson <hans-johnson@uiowa.edu>
  • Loading branch information
hjmjohnson authored Jul 9, 2024
1 parent 3a0c2d5 commit 8cfbcba
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion runtests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ function clang_format {
}

function is_pip_installed() {
return $("${PY_EXE}" -c "import sys, pkgutil; sys.exit(0 if pkgutil.find_loader(sys.argv[1]) else 1)" $1)
return $("${PY_EXE}" -c "import sys, importlib.util; sys.exit(0 if importlib.util.find_spec(sys.argv[1]) else 1)" $1)
}

function clean_py {
Expand Down

0 comments on commit 8cfbcba

Please sign in to comment.