@@ -476,7 +476,7 @@ adjust_tp_compare(int c)
476476 ? (t)->tp_richcompare : NULL)
477477
478478/* Map rich comparison operators to their swapped version, e.g. LT --> GT */
479- static int swapped_op [] = {Py_GT , Py_GE , Py_EQ , Py_NE , Py_LT , Py_LE };
479+ extern int _Py_SwappedOp [] = {Py_GT , Py_GE , Py_EQ , Py_NE , Py_LT , Py_LE };
480480
481481/* Try a genuine rich comparison, returning an object. Return:
482482 NULL for exception;
@@ -494,7 +494,7 @@ try_rich_compare(PyObject *v, PyObject *w, int op)
494494 if (v -> ob_type != w -> ob_type &&
495495 PyType_IsSubtype (w -> ob_type , v -> ob_type ) &&
496496 (f = RICHCOMPARE (w -> ob_type )) != NULL ) {
497- res = (* f )(w , v , swapped_op [op ]);
497+ res = (* f )(w , v , _Py_SwappedOp [op ]);
498498 if (res != Py_NotImplemented )
499499 return res ;
500500 Py_DECREF (res );
@@ -506,7 +506,7 @@ try_rich_compare(PyObject *v, PyObject *w, int op)
506506 Py_DECREF (res );
507507 }
508508 if ((f = RICHCOMPARE (w -> ob_type )) != NULL ) {
509- return (* f )(w , v , swapped_op [op ]);
509+ return (* f )(w , v , _Py_SwappedOp [op ]);
510510 }
511511 res = Py_NotImplemented ;
512512 Py_INCREF (res );
@@ -1703,7 +1703,7 @@ PyObject_Dir(PyObject *arg)
17031703
17041704 assert (result );
17051705 if (!PyList_Check (result )) {
1706- PyErr_SetString (PyExc_TypeError ,
1706+ PyErr_SetString (PyExc_TypeError ,
17071707 "Expected keys() to be a list." );
17081708 goto error ;
17091709 }
0 commit comments