Commit 296ec661 authored by Jim Fulton's avatar Jim Fulton

Changed so getting an object's __class__ does not cause it's

activation.
parent d2d8b740
/* /*
$Id: cPersistence.c,v 1.15 1997/06/06 19:04:40 jim Exp $ $Id: cPersistence.c,v 1.16 1997/06/30 15:26:35 jim Exp $
C Persistence Module C Persistence Module
...@@ -56,7 +56,7 @@ ...@@ -56,7 +56,7 @@
*****************************************************************************/ *****************************************************************************/
static char *what_string = "$Id: cPersistence.c,v 1.15 1997/06/06 19:04:40 jim Exp $"; static char *what_string = "$Id: cPersistence.c,v 1.16 1997/06/30 15:26:35 jim Exp $";
#include <time.h> #include <time.h>
#include "cPersistence.h" #include "cPersistence.h"
...@@ -724,8 +724,11 @@ Per_getattr(cPersistentObject *self, PyObject *oname, char *name, ...@@ -724,8 +724,11 @@ Per_getattr(cPersistentObject *self, PyObject *oname, char *name,
} }
break; break;
} }
return getattrf((PyObject *)self, oname);
} }
if(! (*name++=='_' && *name++=='_' && strcmp(name,"dict__")==0)) if(! (*name++=='_' && *name++=='_' &&
(strcmp(name,"dict__")==0 || strcmp(name,"class__")==0)))
{ {
/* Update state, if necessary */ /* Update state, if necessary */
if(self->state==GHOST_STATE && self->jar) if(self->state==GHOST_STATE && self->jar)
...@@ -933,7 +936,7 @@ void ...@@ -933,7 +936,7 @@ void
initcPersistence() initcPersistence()
{ {
PyObject *m, *d; PyObject *m, *d;
char *rev="$Revision: 1.15 $"; char *rev="$Revision: 1.16 $";
PATimeType.ob_type=&PyType_Type; PATimeType.ob_type=&PyType_Type;
...@@ -960,6 +963,10 @@ initcPersistence() ...@@ -960,6 +963,10 @@ initcPersistence()
/**************************************************************************** /****************************************************************************
$Log: cPersistence.c,v $ $Log: cPersistence.c,v $
Revision 1.16 1997/06/30 15:26:35 jim
Changed so getting an object's __class__ does not cause it's
activation.
Revision 1.15 1997/06/06 19:04:40 jim Revision 1.15 1997/06/06 19:04:40 jim
Modified so that C API setstate makes object temporarily Modified so that C API setstate makes object temporarily
undeactivatable. undeactivatable.
......
/* /*
$Id: cPersistence.c,v 1.15 1997/06/06 19:04:40 jim Exp $ $Id: cPersistence.c,v 1.16 1997/06/30 15:26:35 jim Exp $
C Persistence Module C Persistence Module
...@@ -56,7 +56,7 @@ ...@@ -56,7 +56,7 @@
*****************************************************************************/ *****************************************************************************/
static char *what_string = "$Id: cPersistence.c,v 1.15 1997/06/06 19:04:40 jim Exp $"; static char *what_string = "$Id: cPersistence.c,v 1.16 1997/06/30 15:26:35 jim Exp $";
#include <time.h> #include <time.h>
#include "cPersistence.h" #include "cPersistence.h"
...@@ -724,8 +724,11 @@ Per_getattr(cPersistentObject *self, PyObject *oname, char *name, ...@@ -724,8 +724,11 @@ Per_getattr(cPersistentObject *self, PyObject *oname, char *name,
} }
break; break;
} }
return getattrf((PyObject *)self, oname);
} }
if(! (*name++=='_' && *name++=='_' && strcmp(name,"dict__")==0)) if(! (*name++=='_' && *name++=='_' &&
(strcmp(name,"dict__")==0 || strcmp(name,"class__")==0)))
{ {
/* Update state, if necessary */ /* Update state, if necessary */
if(self->state==GHOST_STATE && self->jar) if(self->state==GHOST_STATE && self->jar)
...@@ -933,7 +936,7 @@ void ...@@ -933,7 +936,7 @@ void
initcPersistence() initcPersistence()
{ {
PyObject *m, *d; PyObject *m, *d;
char *rev="$Revision: 1.15 $"; char *rev="$Revision: 1.16 $";
PATimeType.ob_type=&PyType_Type; PATimeType.ob_type=&PyType_Type;
...@@ -960,6 +963,10 @@ initcPersistence() ...@@ -960,6 +963,10 @@ initcPersistence()
/**************************************************************************** /****************************************************************************
$Log: cPersistence.c,v $ $Log: cPersistence.c,v $
Revision 1.16 1997/06/30 15:26:35 jim
Changed so getting an object's __class__ does not cause it's
activation.
Revision 1.15 1997/06/06 19:04:40 jim Revision 1.15 1997/06/06 19:04:40 jim
Modified so that C API setstate makes object temporarily Modified so that C API setstate makes object temporarily
undeactivatable. undeactivatable.
......
/* /*
$Id: cPersistence.c,v 1.15 1997/06/06 19:04:40 jim Exp $ $Id: cPersistence.c,v 1.16 1997/06/30 15:26:35 jim Exp $
C Persistence Module C Persistence Module
...@@ -56,7 +56,7 @@ ...@@ -56,7 +56,7 @@
*****************************************************************************/ *****************************************************************************/
static char *what_string = "$Id: cPersistence.c,v 1.15 1997/06/06 19:04:40 jim Exp $"; static char *what_string = "$Id: cPersistence.c,v 1.16 1997/06/30 15:26:35 jim Exp $";
#include <time.h> #include <time.h>
#include "cPersistence.h" #include "cPersistence.h"
...@@ -724,8 +724,11 @@ Per_getattr(cPersistentObject *self, PyObject *oname, char *name, ...@@ -724,8 +724,11 @@ Per_getattr(cPersistentObject *self, PyObject *oname, char *name,
} }
break; break;
} }
return getattrf((PyObject *)self, oname);
} }
if(! (*name++=='_' && *name++=='_' && strcmp(name,"dict__")==0)) if(! (*name++=='_' && *name++=='_' &&
(strcmp(name,"dict__")==0 || strcmp(name,"class__")==0)))
{ {
/* Update state, if necessary */ /* Update state, if necessary */
if(self->state==GHOST_STATE && self->jar) if(self->state==GHOST_STATE && self->jar)
...@@ -933,7 +936,7 @@ void ...@@ -933,7 +936,7 @@ void
initcPersistence() initcPersistence()
{ {
PyObject *m, *d; PyObject *m, *d;
char *rev="$Revision: 1.15 $"; char *rev="$Revision: 1.16 $";
PATimeType.ob_type=&PyType_Type; PATimeType.ob_type=&PyType_Type;
...@@ -960,6 +963,10 @@ initcPersistence() ...@@ -960,6 +963,10 @@ initcPersistence()
/**************************************************************************** /****************************************************************************
$Log: cPersistence.c,v $ $Log: cPersistence.c,v $
Revision 1.16 1997/06/30 15:26:35 jim
Changed so getting an object's __class__ does not cause it's
activation.
Revision 1.15 1997/06/06 19:04:40 jim Revision 1.15 1997/06/06 19:04:40 jim
Modified so that C API setstate makes object temporarily Modified so that C API setstate makes object temporarily
undeactivatable. undeactivatable.
......
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