Skip to content

Module imp deprecated and removed in Python3.12

While trying to implement CI:

ImportError while importing test module '/builds/placoto/placoto-cli/tests/TestCase1.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/local/lib/python3.12/importlib/__init__.py:90: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/TestCase1.py:2: in <module>
    from .executor import execute_test_case
tests/executor.py:5: in <module>
    from eoq2.action.externalpy import ExternalPyScriptHandler
venv/lib/python3.12/site-packages/eoq2/action/externalpy/__init__.py:1: in <module>
    from .externalpyscripthandler import *
venv/lib/python3.12/site-packages/eoq2/action/externalpy/externalpyscripthandler.py:18: in <module>
    import imp
E   ModuleNotFoundError: No module named 'imp'

Refactor in favor of importlib.