diff options
author | Benjamin Peterson <benjamin@python.org> | 2009-07-02 17:19:22 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2009-07-02 17:19:22 (GMT) |
commit | f92146938377651100db8a00bb3356ceff760037 (patch) | |
tree | 5ce1689d4ea682c943dd07212ada086bdc4778b8 /Objects | |
parent | 585ad8ae5e352c99bbd87955c64cc9a0654da8c3 (diff) | |
download | cpython-f92146938377651100db8a00bb3356ceff760037.zip cpython-f92146938377651100db8a00bb3356ceff760037.tar.gz cpython-f92146938377651100db8a00bb3356ceff760037.tar.bz2 |
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
........
Diffstat (limited to 'Objects')
-rw-r--r-- | Objects/methodobject.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/Objects/methodobject.c b/Objects/methodobject.c index 737a3f7..69d7791 100644 --- a/Objects/methodobject.c +++ b/Objects/methodobject.c @@ -230,12 +230,9 @@ meth_richcompare(PyObject *self, PyObject *other, int op) 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 @@ meth_richcompare(PyObject *self, PyObject *other, int op) 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; |