1diff --git a/bindings/pyroot/src/MethodProxy.cxx b/bindings/pyroot/src/MethodProxy.cxx
2--- a/bindings/pyroot/src/MethodProxy.cxx
3+++ b/bindings/pyroot/src/MethodProxy.cxx
4@@ -4,10 +4,10 @@
5 // Bindings
6 #include "PyROOT.h"
7 #include "structmember.h" // from Python
8-#if PY_VERSION_HEX >= 0x02050000
9-#include "code.h" // from Python
10-#else
11+#if PY_VERSION_HEX < 0x02050000
12 #include "compile.h" // from Python
13+#elif PY_VERSION_HEX < 0x030b0000
14+#include "code.h" // from Python
15 #endif
16 #ifndef CO_NOFREE
17 // python2.2 does not have CO_NOFREE defined