Code.h etc. have been moved in Python 3.11


According to Porting to Python 3.11 of “What’s New In Python 3.11 — Python 3.11.0b4 documentation”,

The non-limited API files cellobject.h, classobject.h, code.h, context.h, funcobject.h, genobject.h and longintrepr.h have been moved to the Include/cpython directory. Moreover, the eval.h header file was removed. These files must not be included directly, as they are already included in Python.h: Include Files. If they have been included directly, consider including Python.h instead. (Contributed by Victor Stinner in bpo-35134.)

So, to build the current master w/ python 3.11.0b3, I made the following modification:

diff --git a/bindings/pyroot/cppyy/CPyCppyy/src/CPPOverload.cxx b/bindings/pyroot/cppyy/CPyCppyy/src/CPPOverload.cxx
index 59997e390d..33a6a5da52 100644
--- a/bindings/pyroot/cppyy/CPyCppyy/src/CPPOverload.cxx
+++ b/bindings/pyroot/cppyy/CPyCppyy/src/CPPOverload.cxx
@@ -1,7 +1,7 @@
 // Bindings
 #include "CPyCppyy.h"
 #include "structmember.h"    // from Python
-#if PY_VERSION_HEX >= 0x02050000
+#if PY_VERSION_HEX >= 0x02050000 && PY_VERSION_HEX < 0x030B0000
 #include "code.h"            // from Python
 #include "compile.h"         // from Python


Please read tips for efficient and successful posting and posting code

ROOT Version: master
Platform: Fedora Linux 36
Compiler: g++ (GCC) 12.1.1 20220507 (Red Hat 12.1.1-1)

1 Like

Thanks a lot for the information! I’m sure @etejedor will be interested


We had already taken care of it in master actually:

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.