diff --git a/pyang/repository.py b/pyang/repository.py index 37c388b4..5e37dee4 100644 --- a/pyang/repository.py +++ b/pyang/repository.py @@ -79,8 +79,8 @@ def __init__(self, path="", use_env=True, no_path_recurse=False, # but the real location is `/usr/local` # if the package is installed with pip # this information can be easily retrieved - import pkgutil - if not pkgutil.find_loader('pip'): + import importlib + if not importlib.util.find_spec('pip'): break # abort search if pip is not installed # hack below to handle pip 10 internals