summaryrefslogtreecommitdiff
path: root/Modules/md5module.c
diff options
context:
space:
mode:
authorFred Drake <fdrake@acm.org>2001-11-02 22:05:06 +0000
committerFred Drake <fdrake@acm.org>2001-11-02 22:05:06 +0000
commit79e8893621e3cae3d901f3a73a0ac24d54835b25 (patch)
treea7184280e26aa48877896bdbd7f7357338f1fa6d /Modules/md5module.c
parent0d4d6572aee34275df87b2d80403c52ea7435ff5 (diff)
downloadcpython-79e8893621e3cae3d901f3a73a0ac24d54835b25.tar.gz
Simplify initmd5() to use PyModule_AddIntConstant().
Diffstat (limited to 'Modules/md5module.c')
-rw-r--r--Modules/md5module.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/Modules/md5module.c b/Modules/md5module.c
index 82bd415d76..beb743f765 100644
--- a/Modules/md5module.c
+++ b/Modules/md5module.c
@@ -268,13 +268,12 @@ static PyMethodDef md5_functions[] = {
DL_EXPORT(void)
initmd5(void)
{
- PyObject *m, *d, *i;
+ PyObject *m, *d;
MD5type.ob_type = &PyType_Type;
m = Py_InitModule3("md5", md5_functions, module_doc);
d = PyModule_GetDict(m);
PyDict_SetItemString(d, "MD5Type", (PyObject *)&MD5type);
- if ( (i = PyInt_FromLong(16)) != NULL)
- PyDict_SetItemString(d, "digest_size", i);
+ PyModule_AddIntConstant(m, "digest_size", 16);
/* No need to check the error here, the caller will do that */
}