chiark
/
gitweb
/
~mdw
/
pyke
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Stamp the module name onto types properly.
[pyke]
/
util.c
diff --git
a/util.c
b/util.c
index f56c7fd0c52524665deb176d3ac5200b978903dc..717c3d97258413f99a04e7f81e9bfbd03d6e958a 100644
(file)
--- a/
util.c
+++ b/
util.c
@@
-170,9
+170,12
@@
void *newtype(PyTypeObject *metaty,
PyTypeObject *inittype(PyTypeObject *tyskel)
{
PyTypeObject *inittype(PyTypeObject *tyskel)
{
+ static PyObject *modname = 0;
PyTypeObject *ty = newtype(&PyType_Type, tyskel, 0);
PyTypeObject *ty = newtype(&PyType_Type, tyskel, 0);
+ if (!modname) modname = PyString_FromString("catacomb");
ty->tp_flags |= Py_TPFLAGS_HEAPTYPE;
PyType_Ready(ty);
ty->tp_flags |= Py_TPFLAGS_HEAPTYPE;
PyType_Ready(ty);
+ PyDict_SetItemString(ty->tp_dict, "__module__", modname);
return (ty);
}
return (ty);
}