diff --git a/psycopg/python.h b/psycopg/python.h index 9567c965..f4256d8d 100644 --- a/psycopg/python.h +++ b/psycopg/python.h @@ -54,7 +54,7 @@ #endif #ifndef Py_TYPE - #define Py_TYPE(o) ((o)->ob_type) + #define Py_TYPE(o) (((PyObject*)(o))->ob_type) #endif /* FORMAT_CODE_PY_SSIZE_T is for Py_ssize_t: */