aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'Objects/moduleobject.c')
-rw-r--r--Objects/moduleobject.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/Objects/moduleobject.c b/Objects/moduleobject.c
index 6590387dac5..e57ea86e769 100644
--- a/Objects/moduleobject.c
+++ b/Objects/moduleobject.c
@@ -35,6 +35,19 @@ PyTypeObject PyModuleDef_Type = {
};
+int
+_PyModule_IsExtension(PyObject *obj)
+{
+ if (!PyModule_Check(obj)) {
+ return 0;
+ }
+ PyModuleObject *module = (PyModuleObject*)obj;
+
+ struct PyModuleDef *def = module->md_def;
+ return (def != NULL && def->m_methods != NULL);
+}
+
+
PyObject*
PyModuleDef_Init(struct PyModuleDef* def)
{