Mercurial > cpython-lru_cache-weakref
diff Objects/methodobject.c @ 55052:7dc0d2c4b520 2.6
Merged revisions 73774 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r73774 | benjamin.peterson | 2009-07-02 12:06:17 -0500 (Thu, 02 Jul 2009) | 1 line
only order comparisons are removed in py3k #6119
........
| author | Benjamin Peterson <benjamin@python.org> |
|---|---|
| date | Thu, 02 Jul 2009 17:19:22 +0000 |
| parents | 52294af4b663 |
| children | fd25030223b0 |
line wrap: on
line diff
--- a/Objects/methodobject.c Thu Jul 02 15:37:21 2009 +0000 +++ b/Objects/methodobject.c Thu Jul 02 17:19:22 2009 +0000 @@ -230,12 +230,9 @@ PyObject *res; int eq; - if ((op != Py_EQ && op != Py_NE) || - !PyCFunction_Check(self) || - !PyCFunction_Check(other)) - { - /* Py3K warning if types are not equal and comparison isn't == or != */ - if (PyErr_WarnPy3k("builtin_function_or_method inequality " + if (op != Py_EQ && op != Py_NE) { + /* Py3K warning if comparison isn't == or !=. */ + if (PyErr_WarnPy3k("builtin_function_or_method order " "comparisons not supported in 3.x", 1) < 0) { return NULL; } @@ -243,6 +240,10 @@ Py_INCREF(Py_NotImplemented); return Py_NotImplemented; } + else if (!PyCFunction_Check(self) || !PyCFunction_Check(other)) { + Py_INCREF(Py_NotImplemented); + return Py_NotImplemented; + } a = (PyCFunctionObject *)self; b = (PyCFunctionObject *)other; eq = a->m_self == b->m_self;
