From 7b97bbe998da68724053f522e4c3eaeed405eacc Mon Sep 17 00:00:00 2001 From: scott snyder Date: Mon, 28 Oct 2019 14:40:29 +0100 Subject: [PATCH] AthenaPython: Fix compilation with py3. Fix for compilation with python3. --- Control/AthenaPython/src/PyAthenaUtils.cxx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Control/AthenaPython/src/PyAthenaUtils.cxx b/Control/AthenaPython/src/PyAthenaUtils.cxx index 628322a1b30..cf5dc9b5b94 100644 --- a/Control/AthenaPython/src/PyAthenaUtils.cxx +++ b/Control/AthenaPython/src/PyAthenaUtils.cxx @@ -172,8 +172,13 @@ PyAthena::callPyMethod ATLAS_NOT_THREAD_SAFE ( PyObject* self, throw_py_exception(); } +#if PY_VERSION_HEX < 0x03000000 if ( PyInt_Check( r ) || PyLong_Check(r) ) { StatusCode sc(PyInt_AS_LONG( r )); +#else + if ( PyLong_Check( r ) ) { + StatusCode sc(PyLong_AS_LONG( r )); +#endif Py_DECREF( r ); return sc; } -- GitLab