Browse Source

Fix a few issues with obscure CPython-based deployments

rdb 9 years ago
parent
commit
bb684b2a07

+ 1 - 1
dtool/src/interrogate/interfaceMakerPythonNative.cxx

@@ -2788,7 +2788,7 @@ write_module_class(ostream &out, Object *obj) {
   // struct PyMethodDef *tp_methods;
   out << "    Dtool_Methods_" << ClassName << ",\n";
   // struct PyMemberDef *tp_members;
-  out << "    standard_type_members,\n";
+  out << "    0, // tp_members\n";
 
   // struct PyGetSetDef *tp_getset;
   if (num_getset > 0) {

+ 6 - 0
dtool/src/pystub/pystub.cxx

@@ -61,6 +61,7 @@ extern "C" {
   EXPCL_PYSTUB int PyGILState_Ensure(...);
   EXPCL_PYSTUB int PyGILState_Release(...);
   EXPCL_PYSTUB int PyImport_GetModuleDict(...);
+  EXPCL_PYSTUB int PyImport_ImportModule(...);
   EXPCL_PYSTUB int PyInt_AsLong(...);
   EXPCL_PYSTUB int PyInt_AsSsize_t(...);
   EXPCL_PYSTUB int PyInt_FromLong(...);
@@ -169,6 +170,7 @@ extern "C" {
   EXPCL_PYSTUB int PyUnicode_InternInPlace(...);
   EXPCL_PYSTUB int PyUnicode_Type(...);
   EXPCL_PYSTUB int Py_BuildValue(...);
+  EXPCL_PYSTUB int Py_GetVersion(...);
   EXPCL_PYSTUB int Py_InitModule4(...);
   EXPCL_PYSTUB int Py_InitModule4_64(...);
   EXPCL_PYSTUB int Py_InitModule4TraceRefs(...);
@@ -195,6 +197,7 @@ extern "C" {
   EXPCL_PYSTUB extern void *PyExc_ConnectionError;
   EXPCL_PYSTUB extern void *PyExc_Exception;
   EXPCL_PYSTUB extern void *PyExc_FutureWarning;
+  EXPCL_PYSTUB extern void *PyExc_ImportError;
   EXPCL_PYSTUB extern void *PyExc_IndexError;
   EXPCL_PYSTUB extern void *PyExc_OSError;
   EXPCL_PYSTUB extern void *PyExc_RuntimeError;
@@ -258,6 +261,7 @@ int PyGen_Type(...) { return 0; }
 int PyGILState_Ensure(...) { return 0; }
 int PyGILState_Release(...) { return 0; }
 int PyImport_GetModuleDict(...) { return 0; }
+int PyImport_ImportModule(...) { return 0; }
 int PyInt_AsLong(...) { return 0; }
 int PyInt_AsSsize_t(...) { return 0; }
 int PyInt_FromLong(...) { return 0; }
@@ -365,6 +369,7 @@ int PyUnicode_GetSize(...) { return 0; }
 int PyUnicode_InternFromString(...) { return 0; }
 int PyUnicode_InternInPlace(...) { return 0; }
 int PyUnicode_Type(...) { return 0; }
+int Py_GetVersion(...) { return 0; }
 int Py_BuildValue(...) { return 0; }
 int Py_InitModule4(...) { return 0; }
 int Py_InitModule4_64(...) { return 0; }
@@ -397,6 +402,7 @@ void *PyExc_BufferError = (void *)NULL;
 void *PyExc_ConnectionError = (void *)NULL;
 void *PyExc_Exception = (void *)NULL;
 void *PyExc_FutureWarning = (void *)NULL;
+void *PyExc_ImportError = (void *)NULL;
 void *PyExc_IndexError = (void *)NULL;
 void *PyExc_OSError = (void *)NULL;
 void *PyExc_RuntimeError = (void *)NULL;