The windows-2022 GitHub runner image no longer ships Python 3.10, so
PCbuild/find_python.bat fell through to NuGet and installed the latest
pythonx86 package, which is now 3.15.1. Python 3.15 removed
Loader.load_module(), which Python/makeopcodetargets.py used to import
Lib/opcode.py, so the _RegenOpcodes target failed and broke every
Windows CI build on this branch.
Load Lib/opcode.py through importlib.util instead, and extend the py.exe
search list in find_python.bat up to 3.14 so the build picks up the
runner's preinstalled Python rather than whatever NuGet considers latest.
Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
* Specialize LOAD_ATTR with LOAD_ATTR_SLOT and LOAD_ATTR_SPLIT_KEYS
* Move dict-common.h to internal/pycore_dict.h
* Add LOAD_ATTR_WITH_HINT specialized opcode.
* Quicken in function if loopy
* Specialize LOAD_ATTR for module attributes.
* Add specialization stats
Issue #20021: use importlib.machinery to import Lib/opcode.py and not an opcode
module coming from somewhere else. makeopcodetargets.py is part of the Python
build process and it is run by an external Python program, not the built Python
program.
Patch written by Serhiy Storchaka.
* Simply use "import opcode" to import the opcode module instead of tricks
using the imp module
* Use context manager for the output file
* Move code into a new main() function
* Replace assert with a regular if to check the number of arguments
* Import modules at top level
on compilers that support it (notably: gcc, SunPro, icc), the bytecode
evaluation loop is compiled with a new dispatch mechanism which gives
speedups of up to 20%, depending on the system, on various benchmarks.