Commit eae46dd0 authored by Jim Fulton's avatar Jim Fulton

Added import of InvalidObjectReference (error).

parent 44b77a04
...@@ -94,6 +94,7 @@ static void PyVar_Assign(PyObject **v, PyObject *e) { Py_XDECREF(*v); *v=e;} ...@@ -94,6 +94,7 @@ static void PyVar_Assign(PyObject **v, PyObject *e) { Py_XDECREF(*v); *v=e;}
static PyObject *py__p_oid, *py__p_jar, *py___getinitargs__, *py___module__; static PyObject *py__p_oid, *py__p_jar, *py___getinitargs__, *py___module__;
static PyObject *py_new_oid, *py___class__, *py___name__; static PyObject *py_new_oid, *py___class__, *py___name__;
static PyObject *InvalidObjectReference;
typedef struct { typedef struct {
PyObject_HEAD PyObject_HEAD
...@@ -306,7 +307,7 @@ void ...@@ -306,7 +307,7 @@ void
initcoptimizations() initcoptimizations()
{ {
PyObject *m, *d; PyObject *m, *d;
char *rev="$Revision: 1.5 $"; char *rev="$Revision: 1.6 $";
#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);
...@@ -317,6 +318,14 @@ initcoptimizations() ...@@ -317,6 +318,14 @@ initcoptimizations()
make_string(__name__); make_string(__name__);
make_string(new_oid); make_string(new_oid);
/* Get InvalidObjectReference error */
UNLESS (m=PyString_FromString("POSException")) return;
ASSIGN(m, PyImport_Import(m));
UNLESS (m) return;
ASSIGN(m, PyObject_GetAttrString(m, "InvalidObjectReference"));
UNLESS (m) return;
InvalidObjectReference=m;
UNLESS (ExtensionClassImported) return; UNLESS (ExtensionClassImported) return;
m = Py_InitModule4("coptimizations", Module_Level__methods, m = Py_InitModule4("coptimizations", Module_Level__methods,
......
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