From f420078a288dcc661bd030355ac30618fde7868e Mon Sep 17 00:00:00 2001 From: zm711 <92116279+zm711@users.noreply.github.com> Date: Thu, 26 Oct 2023 15:00:44 -0400 Subject: [PATCH] imp -> importlib --- phy/utils/plugin.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/phy/utils/plugin.py b/phy/utils/plugin.py index bdd97be0b..6632fc4bf 100644 --- a/phy/utils/plugin.py +++ b/phy/utils/plugin.py @@ -11,7 +11,7 @@ # Imports #------------------------------------------------------------------------------ -import imp +import importlib import logging import os from pathlib import Path @@ -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: