Skip to content

Commit 8f95f1c

Browse files
committed
Fix compiler warnings about compare_handler
1 parent ee2f3f4 commit 8f95f1c

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

CXX/Python2/cxx_extensions.cxx

+4
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,9 @@ extern "C"
261261
static int setattr_handler( PyObject *, char *, PyObject * );
262262
static PyObject *getattro_handler( PyObject *, PyObject * );
263263
static int setattro_handler( PyObject *, PyObject *, PyObject * );
264+
#if defined( PYCXX_PYTHON_2TO3 )
264265
static int compare_handler( PyObject *, PyObject * );
266+
#endif
265267
static PyObject *rich_compare_handler( PyObject *, PyObject *, int );
266268
static PyObject *repr_handler( PyObject * );
267269
static PyObject *str_handler( PyObject * );
@@ -723,6 +725,7 @@ extern "C" int setattro_handler( PyObject *self, PyObject *name, PyObject *value
723725
}
724726
}
725727

728+
#if defined( PYCXX_PYTHON_2TO3 )
726729
extern "C" int compare_handler( PyObject *self, PyObject *other )
727730
{
728731
try
@@ -735,6 +738,7 @@ extern "C" int compare_handler( PyObject *self, PyObject *other )
735738
return -1; // indicate error
736739
}
737740
}
741+
#endif
738742

739743
#if PY_MAJOR_VERSION > 2 || (PY_MAJOR_VERSION == 2 && PY_MINOR_VERSION >= 1)
740744
extern "C" PyObject *rich_compare_handler( PyObject *self, PyObject *other, int op )

0 commit comments

Comments
 (0)