aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Piotr Jaroszyński <peper@gentoo.org> 2007-07-09 00:02:21 +0000
committerAvatar Piotr Jaroszyński <peper@gentoo.org> 2007-07-09 00:02:21 +0000
commitd68fd591a03b2da991dc5de3439a61f0243493bc (patch)
tree11930be49784b26910f8cc5150b1e9ee80c7123c
parent42bd1a60d171fb5f0269c1a97b3cb8d76799b7a7 (diff)
downloadpaludis-d68fd591a03b2da991dc5de3439a61f0243493bc.tar.gz
paludis-d68fd591a03b2da991dc5de3439a61f0243493bc.tar.xz
(python) Add docstrings to enums.
-rw-r--r--python/paludis_python.hh5
1 files changed, 2 insertions, 3 deletions
diff --git a/python/paludis_python.hh b/python/paludis_python.hh
index 8c73a2f..68c5e87 100644
--- a/python/paludis_python.hh
+++ b/python/paludis_python.hh
@@ -102,9 +102,8 @@ namespace paludis
enum_.value(e_name_up.c_str(), e);
doc += "\n\t" + e_name_up;
}
- // FIXME __doc__ is ro...
- PyObject * py_doc = PyString_FromString(doc.c_str());
- PyObject_SetAttrString(enum_.ptr(), "__doc__", py_doc);
+ PyTypeObject * pto = reinterpret_cast<PyTypeObject *>(enum_.ptr());
+ PyDict_SetItemString(pto->tp_dict, "__doc__", PyString_FromString(doc.c_str()));
}
// Compare