extensions: imp module is removed in Python 3.12 - use importlib to load files
imp has been deprecated for a long time, and has finally been removed in Python
3.12 .
imp was only used for loading extensions that has been specified with direct
.py path or path to a package directory. The same use cases can be achieved
quite simple with importlib, , possiby with small changes in corner cases with
undefined behaviour, such as extensions without .py source.
There might also be corner cases and undefined behaviour around use of
sys.modules and reloading.
syntax: glob
*.elc
*.tmp
*.orig
*.rej
*~
*.mergebackup
*.o
*.so
*.dll
*.exe
*.pyd
*.pyc
*.pyo
*$py.class
*.swp
*.prof
*.zip
\#*\#
.\#*
result/
tests/artifacts/cache/big-file-churn.hg
tests/.coverage*
tests/.testtimes*
# the file is written in the CWD when run-tests is run.
.testtimes
tests/.hypothesis
tests/hypothesis-generated
tests/annotated
tests/exceptions
tests/python3
tests/*.err
tests/htmlcov
build
contrib/chg/chg
contrib/hgsh/hgsh
contrib/vagrant/.vagrant
contrib/merge-lists/target/
dist
packages
doc/common.txt
doc/*.[0-9]
doc/*.[0-9].txt
doc/*.[0-9].gendoc.txt
doc/*.[0-9].{x,ht}ml
MANIFEST
MANIFEST.in
patches
mercurial/__modulepolicy__.py
mercurial/__version__.py
mercurial/hgpythonlib.h
mercurial.egg-info
.DS_Store
tags
cscope.*
.vscode/*
.idea/*
.asv/*
.pytype/*
.mypy_cache
i18n/hg.pot
locale/*/LC_MESSAGES/hg.mo
hgext/__index__.py
rust/target/
rust/*/target/
# Generated wheels
wheelhouse/
syntax: rootglob
# See Profiling in rust/README.rst
.cargo/config
syntax: regexp
^\.pc/
^\.(pydev)?project
# hackable windows distribution additions
^hg-python
^hg.py$