Skip to content

Commit

Permalink
imp -> importlib
Browse files Browse the repository at this point in the history
  • Loading branch information
zm711 committed Oct 26, 2023
1 parent 8bf8cf7 commit f420078
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions phy/utils/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
# Imports
#------------------------------------------------------------------------------

import imp
import importlib
import logging
import os
from pathlib import Path
Expand Down Expand Up @@ -101,12 +101,12 @@ def discover_plugins(dirs):
modname = path.stem
if modname in ('phy_config', 'phycontrib_loader'):
continue
file, path, descr = imp.find_module(modname, [subdir])
file, path, descr = importlib.util.find_spec(modname, [subdir])
if file:
# Loading the module registers the plugin in
# IPluginRegistry.
try:
mod = imp.load_module(modname, file, path, descr) # noqa
mod = importlib.load_module(modname, file, path, descr) # noqa
except Exception as e: # pragma: no cover
logger.exception(e)
finally:
Expand Down

0 comments on commit f420078

Please sign in to comment.