4133 static void
4134 PLy_init_plpy(void)
4135 {
4136 PyObject *main_mod,
4137 *main_dict,
4138 *plpy_mod;
4139 PyObject *plpy;
4140
4141 /*
4142 * initialize plpy module
4143 */
4144 if (PyType_Ready(&PLy_PlanType) < 0)
when PyType_Ready() succeeds
taking False path
4145 elog(ERROR, "could not initialize PLy_PlanType");
4146 if (PyType_Ready(&PLy_ResultType) < 0)
when PyType_Ready() fails
taking True path
4147 elog(ERROR, "could not initialize PLy_ResultType");
4148 if (PyType_Ready(&PLy_SubtransactionType) < 0)
when PyType_Ready() succeeds
taking False path
4149 elog(ERROR, "could not initialize PLy_SubtransactionType");
4150
4151 #if PY_MAJOR_VERSION >= 3
4152 plpy = PyModule_Create(&PLy_module);
4153 /* for Python 3 we initialized the exceptions in PyInit_plpy */
4154 #else
4155 plpy = Py_InitModule("plpy", PLy_methods);
when Py_InitModule4_64() succeeds
4156 PLy_add_exceptions(plpy);
4157 #endif
4158
4159 /* PyDict_SetItemString(plpy, "PlanType", (PyObject *) &PLy_PlanType); */
4160
4161 /*
4162 * initialize main module, and add plpy
4163 */
4164 main_mod = PyImport_AddModule("__main__");
when PyImport_AddModule() succeeds
4165 main_dict = PyModule_GetDict(main_mod);
4166 plpy_mod = PyImport_AddModule("plpy");
when PyImport_AddModule() fails
4167 PyDict_SetItemString(main_dict, "plpy", plpy_mod);
calling PyDict_SetItemString with NULL as argument 3 (plpy_mod) at plpython.c:4167
found 9 similar trace(s) to this
4168 if (PyErr_Occurred())
4169 elog(ERROR, "could not initialize plpy");
4170 }