Commit 6ebd8388 authored by Jim Fulton's avatar Jim Fulton

Fixed bug in handling method chains used for C inheritence.

parent add66084
/* /*
$Id: ExtensionClass.c,v 1.23 1998/01/21 19:00:49 jim Exp $ $Id: ExtensionClass.c,v 1.24 1998/02/12 16:35:41 jim Exp $
Extension Class Extension Class
...@@ -65,7 +65,7 @@ static char ExtensionClass_module_documentation[] = ...@@ -65,7 +65,7 @@ static char ExtensionClass_module_documentation[] =
" - They provide access to unbound methods,\n" " - They provide access to unbound methods,\n"
" - They can be called to create instances.\n" " - They can be called to create instances.\n"
"\n" "\n"
"$Id: ExtensionClass.c,v 1.23 1998/01/21 19:00:49 jim Exp $\n" "$Id: ExtensionClass.c,v 1.24 1998/02/12 16:35:41 jim Exp $\n"
; ;
#include <stdio.h> #include <stdio.h>
...@@ -1482,13 +1482,13 @@ initializeBaseExtensionClass(PyExtensionClass *self) ...@@ -1482,13 +1482,13 @@ initializeBaseExtensionClass(PyExtensionClass *self)
{ {
if(ml->ml_meth) if(ml->ml_meth)
{ {
UNLESS(-1 != PyMapping_SetItemString( if(! PyMapping_HasKeyString(dict,ml->ml_name) &&
PyMapping_SetItemString(
dict,ml->ml_name, dict,ml->ml_name,
newCMethod(self, NULL, newCMethod(self, NULL, ml->ml_name, ml->ml_meth,
ml->ml_name, ml->ml_flags, ml->ml_doc)
ml->ml_meth, ) < 0
ml->ml_flags, )
ml->ml_doc)))
return NULL; return NULL;
} }
else if(ml->ml_doc && *(ml->ml_doc)) else if(ml->ml_doc && *(ml->ml_doc))
...@@ -3319,7 +3319,7 @@ void ...@@ -3319,7 +3319,7 @@ void
initExtensionClass() initExtensionClass()
{ {
PyObject *m, *d; PyObject *m, *d;
char *rev="$Revision: 1.23 $"; char *rev="$Revision: 1.24 $";
PURE_MIXIN_CLASS(Base, "Minimalbase class for Extension Classes", NULL); PURE_MIXIN_CLASS(Base, "Minimalbase class for Extension Classes", NULL);
PMethodType.ob_type=&PyType_Type; PMethodType.ob_type=&PyType_Type;
...@@ -3360,6 +3360,9 @@ initExtensionClass() ...@@ -3360,6 +3360,9 @@ initExtensionClass()
/**************************************************************************** /****************************************************************************
$Log: ExtensionClass.c,v $ $Log: ExtensionClass.c,v $
Revision 1.24 1998/02/12 16:35:41 jim
Fixed bug in handling method chains used for C inheritence.
Revision 1.23 1998/01/21 19:00:49 jim Revision 1.23 1998/01/21 19:00:49 jim
Fixed __len__ bugs and added free lists for methods and wrappers Fixed __len__ bugs and added free lists for methods and wrappers
......
/* /*
$Id: ExtensionClass.c,v 1.23 1998/01/21 19:00:49 jim Exp $ $Id: ExtensionClass.c,v 1.24 1998/02/12 16:35:41 jim Exp $
Extension Class Extension Class
...@@ -65,7 +65,7 @@ static char ExtensionClass_module_documentation[] = ...@@ -65,7 +65,7 @@ static char ExtensionClass_module_documentation[] =
" - They provide access to unbound methods,\n" " - They provide access to unbound methods,\n"
" - They can be called to create instances.\n" " - They can be called to create instances.\n"
"\n" "\n"
"$Id: ExtensionClass.c,v 1.23 1998/01/21 19:00:49 jim Exp $\n" "$Id: ExtensionClass.c,v 1.24 1998/02/12 16:35:41 jim Exp $\n"
; ;
#include <stdio.h> #include <stdio.h>
...@@ -1482,13 +1482,13 @@ initializeBaseExtensionClass(PyExtensionClass *self) ...@@ -1482,13 +1482,13 @@ initializeBaseExtensionClass(PyExtensionClass *self)
{ {
if(ml->ml_meth) if(ml->ml_meth)
{ {
UNLESS(-1 != PyMapping_SetItemString( if(! PyMapping_HasKeyString(dict,ml->ml_name) &&
PyMapping_SetItemString(
dict,ml->ml_name, dict,ml->ml_name,
newCMethod(self, NULL, newCMethod(self, NULL, ml->ml_name, ml->ml_meth,
ml->ml_name, ml->ml_flags, ml->ml_doc)
ml->ml_meth, ) < 0
ml->ml_flags, )
ml->ml_doc)))
return NULL; return NULL;
} }
else if(ml->ml_doc && *(ml->ml_doc)) else if(ml->ml_doc && *(ml->ml_doc))
...@@ -3319,7 +3319,7 @@ void ...@@ -3319,7 +3319,7 @@ void
initExtensionClass() initExtensionClass()
{ {
PyObject *m, *d; PyObject *m, *d;
char *rev="$Revision: 1.23 $"; char *rev="$Revision: 1.24 $";
PURE_MIXIN_CLASS(Base, "Minimalbase class for Extension Classes", NULL); PURE_MIXIN_CLASS(Base, "Minimalbase class for Extension Classes", NULL);
PMethodType.ob_type=&PyType_Type; PMethodType.ob_type=&PyType_Type;
...@@ -3360,6 +3360,9 @@ initExtensionClass() ...@@ -3360,6 +3360,9 @@ initExtensionClass()
/**************************************************************************** /****************************************************************************
$Log: ExtensionClass.c,v $ $Log: ExtensionClass.c,v $
Revision 1.24 1998/02/12 16:35:41 jim
Fixed bug in handling method chains used for C inheritence.
Revision 1.23 1998/01/21 19:00:49 jim Revision 1.23 1998/01/21 19:00:49 jim
Fixed __len__ bugs and added free lists for methods and wrappers Fixed __len__ bugs and added free lists for methods and wrappers
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment