Resolves build failures under Python 3.12, i.e building on rawhide:
0make[3]: Nothing to be done for 'install-exec-am'.
1 /usr/bin/mkdir -p '/bitcoin/depends/work/staging/aarch64-unknown-linux-gnu/xcb_proto/1.14.1-4a91ac9dc41/bitcoin/depends/aarch64-unknown-linux-gnu/lib/python3.12/site-packages/xcbgen'
2 /usr/bin/install -c -m 644 __init__.py error.py expr.py align.py matcher.py state.py xtypes.py '/bitcoin/depends/work/staging/aarch64-unknown-linux-gnu/xcb_proto/1.14.1-4a91ac9dc41/bitcoin/depends/aarch64-unknown-linux-gnu/lib/python3.12/site-packages/xcbgen'
3Traceback (most recent call last):
4 File "<string>", line 2, in <module>
5ModuleNotFoundError: No module named 'imp'
6make[3]: *** [Makefile:271: install-pkgpythonPYTHON] Error 1
imp
was removed in 3.12: https://docs.python.org/3/library/imp.html.
Github-Pull: #28097 Rebased-From: 7cb88c8b46723d306b96953a6a60c90a4ab211e3
Also being backported for 25.x in #28047.