chiark / gitweb /
algorithms.py: Fiddling with whitespace.
[catacomb-python] / util.c
diff --git a/util.c b/util.c
index 96a4052df31ed847ee277208339da5a5eab6b2df..717c3d97258413f99a04e7f81e9bfbd03d6e958a 100644 (file)
--- a/util.c
+++ b/util.c
@@ -163,16 +163,19 @@ void *newtype(PyTypeObject *metaty,
     ty->ht_name = PyString_FromString(ty->ht_type.tp_name);
   if (ty->ht_name)
     ty->ht_type.tp_name = PyString_AS_STRING(ty->ht_name);
-  PyObject_INIT(&ty->ht_type, metaty);
+  DISCARD(PyObject_INIT(&ty->ht_type, metaty));
   Py_INCREF(metaty);
   return (ty);
 }
 
 PyTypeObject *inittype(PyTypeObject *tyskel)
 {
+  static PyObject *modname = 0;
   PyTypeObject *ty = newtype(&PyType_Type, tyskel, 0);
+  if (!modname) modname = PyString_FromString("catacomb");
   ty->tp_flags |= Py_TPFLAGS_HEAPTYPE;
   PyType_Ready(ty);
+  PyDict_SetItemString(ty->tp_dict, "__module__", modname);
   return (ty);
 }