Commit d9c39a6c authored by 's avatar

Added updated copt with wrapper checking to the trunk

parent 38c8e2f0
...@@ -163,6 +163,18 @@ persistent_id_call(persistent_id *self, PyObject *args, PyObject *kwargs) ...@@ -163,6 +163,18 @@ persistent_id_call(persistent_id *self, PyObject *args, PyObject *kwargs)
& PERSISTENT_TYPE_FLAG) & PERSISTENT_TYPE_FLAG)
) )
goto not_persistent; goto not_persistent;
if (OBJECT(object->ob_type) != klass)
{ /* Wrapped object, whine! */
/*
printf("%s != %s\n",
object->ob_type->tp_name,
(((PyExtensionClass*)klass)->tp_name));
*/
PyErr_SetString(InvalidObjectReference,
"Attempt to store a wrapped persistent object");
return NULL;
}
} }
else else
goto not_persistent; goto not_persistent;
...@@ -307,7 +319,7 @@ void ...@@ -307,7 +319,7 @@ void
initcoptimizations() initcoptimizations()
{ {
PyObject *m, *d; PyObject *m, *d;
char *rev="$Revision: 1.6 $"; char *rev="$Revision: 1.7 $";
#define make_string(S) if (! (py_ ## S=PyString_FromString(#S))) return #define make_string(S) if (! (py_ ## S=PyString_FromString(#S))) return
make_string(_p_oid); make_string(_p_oid);
......
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