Commit 5abf0ba1 authored by Jeremy Hylton's avatar Jeremy Hylton

Change getattr() of TimeStamp to use PyObject_GetAttrString().

When the import changed to be absolute rather than relative, the trick
of using the same Python string for the import and the getattr failed.

Add an assert() that TimeStamp is not NULL.
parent 2aaec3e5
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
static char cPersistence_doc_string[] = static char cPersistence_doc_string[] =
"Defines Persistent mixin class for persistent objects.\n" "Defines Persistent mixin class for persistent objects.\n"
"\n" "\n"
"$Id: cPersistence.c,v 1.63 2002/09/30 16:02:32 gvanrossum Exp $\n"; "$Id: cPersistence.c,v 1.64 2002/10/01 15:06:17 jeremy Exp $\n";
#include "cPersistence.h" #include "cPersistence.h"
...@@ -853,7 +853,8 @@ initcPersistence(void) ...@@ -853,7 +853,8 @@ initcPersistence(void)
Py_DECREF(s); Py_DECREF(s);
return; return;
} }
TimeStamp = PyObject_GetAttr(m, s); TimeStamp = PyObject_GetAttrString(m, "TimeStamp");
assert(TimeStamp);
Py_DECREF(m); Py_DECREF(m);
Py_DECREF(s); Py_DECREF(s);
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
static char cPersistence_doc_string[] = static char cPersistence_doc_string[] =
"Defines Persistent mixin class for persistent objects.\n" "Defines Persistent mixin class for persistent objects.\n"
"\n" "\n"
"$Id: cPersistence.c,v 1.63 2002/09/30 16:02:32 gvanrossum Exp $\n"; "$Id: cPersistence.c,v 1.64 2002/10/01 15:06:17 jeremy Exp $\n";
#include "cPersistence.h" #include "cPersistence.h"
...@@ -853,7 +853,8 @@ initcPersistence(void) ...@@ -853,7 +853,8 @@ initcPersistence(void)
Py_DECREF(s); Py_DECREF(s);
return; return;
} }
TimeStamp = PyObject_GetAttr(m, s); TimeStamp = PyObject_GetAttrString(m, "TimeStamp");
assert(TimeStamp);
Py_DECREF(m); Py_DECREF(m);
Py_DECREF(s); Py_DECREF(s);
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
static char cPersistence_doc_string[] = static char cPersistence_doc_string[] =
"Defines Persistent mixin class for persistent objects.\n" "Defines Persistent mixin class for persistent objects.\n"
"\n" "\n"
"$Id: cPersistence.c,v 1.63 2002/09/30 16:02:32 gvanrossum Exp $\n"; "$Id: cPersistence.c,v 1.64 2002/10/01 15:06:17 jeremy Exp $\n";
#include "cPersistence.h" #include "cPersistence.h"
...@@ -853,7 +853,8 @@ initcPersistence(void) ...@@ -853,7 +853,8 @@ initcPersistence(void)
Py_DECREF(s); Py_DECREF(s);
return; return;
} }
TimeStamp = PyObject_GetAttr(m, s); TimeStamp = PyObject_GetAttrString(m, "TimeStamp");
assert(TimeStamp);
Py_DECREF(m); Py_DECREF(m);
Py_DECREF(s); Py_DECREF(s);
......
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