Lines Matching defs:module

34     PyModuleObject *module = (PyModuleObject*)obj;
36 PyModuleDef *def = module->md_def;
128 PyObject *nameobj, *module;
132 module = PyModule_NewObject(nameobj);
134 return module;
147 "Python C API version mismatch for module %.100s: "
148 "This Python has API version %d, module %.100s has version %d.",
158 _add_methods_to_object(PyObject *module, PyObject *name, PyMethodDef *functions)
167 "module functions cannot set"
171 func = PyCFunction_NewEx(fdef, (PyObject*)module, name);
175 if (PyObject_SetAttrString(module, fdef->ml_name, func) != 0) {
186 PyModule_Create2(PyModuleDef* module, int module_api_version)
193 return _PyModule_CreateInitialized(module, module_api_version);
197 _PyModule_CreateInitialized(PyModuleDef* module, int module_api_version)
202 if (!PyModuleDef_Init(module))
204 name = module->m_name;
208 if (module->m_slots) {
211 "module %s: PyModule_Create is incompatible with m_slots", name);
217 the module name is "package.module", but the module calls
218 PyModule_Create*() with just "module" for the name. The shared
219 library loader squirrels away the true name of the module in
225 if (p != NULL && strcmp(module->m_name, p+1) == 0) {
233 if (module->m_size > 0) {
234 m->md_state = PyMem_Malloc(module->m_size);
240 memset(m->md_state, 0, module->m_size);
243 if (module->m_methods != NULL) {
244 if (PyModule_AddFunctions((PyObject *) m, module->m_methods) != 0) {
249 if (module->m_doc != NULL) {
250 if (PyModule_SetDocString((PyObject *) m, module->m_doc) != 0) {
255 m->md_def = module;
288 "module %s: m_size may not be negative for multi-phase initialization",
298 "module %s has multiple create slots",
306 "module %s uses unknown slot ID %i",
320 "creation of module %s failed without setting an exception",
327 "creation of module %s raised unreported exception",
346 "module %s is not a module object, but requests module state",
353 "module %s specifies execution slots, but did not create "
384 PyModule_ExecDef(PyObject *module, PyModuleDef *def)
390 name = PyModule_GetName(module);
396 PyModuleObject *md = (PyModuleObject*)module;
419 ret = ((int (*)(PyObject *))cur_slot->value)(module);
424 "execution of module %s failed without setting an exception",
432 "execution of module %s raised unreported exception",
440 "module %s initialized with unknown slot %i",
501 PyErr_SetString(PyExc_SystemError, "nameless module");
517 Py_DECREF(name); /* module dict has still a reference */
536 PyErr_SetString(PyExc_SystemError, "module filename missing");
553 Py_DECREF(fileobj); /* module dict has still a reference */
642 of non-global objects defined in this module can still use
648 class module "PyModuleObject *" "&PyModule_Type"
657 module.__init__
661 Create a module object.
714 /* Check if the "_initializing" attribute of the module spec is set to true.
735 of the module spec.
786 "module '%U' has no attribute '%U' "
792 "cannot access submodule '%U' of module '%U' "
798 "module '%U' has no attribute '%U'",
809 "module has no attribute '%U'", name);
837 PySys_FormatStderr("Exception ignored in m_clear of module%s%V\n",
866 PyErr_Format(PyExc_TypeError, "<module>.__dict__ is not a dictionary");
886 PyErr_Format(PyExc_TypeError, "<module>.__dict__ is not a dictionary");
924 PyErr_Format(PyExc_TypeError, "<module>.__dict__ is not a dictionary");
955 "module", /* tp_name */