summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1997-08-22 16:56:16 (GMT)
committerGuido van Rossum <guido@python.org>1997-08-22 16:56:16 (GMT)
commitcd649654d7fb90ffb05d40406d962d4b06d01b23 (patch)
tree08d541ada9f0907783b728d1f9258f85d35a4a46 /Python
parent289f97d0ea89f0b4b320503ef762c5977fc66393 (diff)
downloadcpython-cd649654d7fb90ffb05d40406d962d4b06d01b23.zip
cpython-cd649654d7fb90ffb05d40406d962d4b06d01b23.tar.gz
cpython-cd649654d7fb90ffb05d40406d962d4b06d01b23.tar.bz2
Reverse the search order for the Don Beaudry hook so that the first
class wins. Makes more sense.
Diffstat (limited to 'Python')
-rw-r--r--Python/ceval.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/Python/ceval.c b/Python/ceval.c
index 07c3ab6..f9c7121 100644
--- a/Python/ceval.c
+++ b/Python/ceval.c
@@ -2683,7 +2683,7 @@ build_class(methods, bases, name)
PyObject *bases; /* tuple containing classes */
PyObject *name; /* string */
{
- int i;
+ int i, n;
if (!PyTuple_Check(bases)) {
PyErr_SetString(PyExc_SystemError,
"build_class with non-tuple bases");
@@ -2699,9 +2699,8 @@ build_class(methods, bases, name)
"build_class witn non-string name");
return NULL;
}
- for (i = PyTuple_Size(bases); --i >= 0; ) {
- /* XXX Is it intentional that the *last* base gets a
- chance at this first? */
+ n = PyTuple_Size(bases);
+ for (i = 0; i < n; i++) {
PyObject *base = PyTuple_GET_ITEM(bases, i);
if (!PyClass_Check(base)) {
/* Call the base's *type*, if it is callable.