Skip to content

Commit

Permalink
Merge pull request #1229 from zm711/imp-deprecation
Browse files Browse the repository at this point in the history
Fix removal of imp in python 3.12
  • Loading branch information
rossant authored May 30, 2024
2 parents 9011f23 + f420078 commit 514c629
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 514c629

Please sign in to comment.