[Python-3000-checkins] r57325 - python/branches/py3k/Modules/binascii.c

neal.norwitz python-3000-checkins at python.org
Thu Aug 23 19:55:34 CEST 2007


Author: neal.norwitz
Date: Thu Aug 23 19:55:33 2007
New Revision: 57325

Modified:
   python/branches/py3k/Modules/binascii.c
Log:
Use a newer API for creating the module so we don't have to create
the docstring manually.  Saves code and a call to PyString_FromString.


Modified: python/branches/py3k/Modules/binascii.c
==============================================================================
--- python/branches/py3k/Modules/binascii.c	(original)
+++ python/branches/py3k/Modules/binascii.c	Thu Aug 23 19:55:33 2007
@@ -1358,14 +1358,11 @@
 	PyObject *m, *d, *x;
 
 	/* Create the module and add the functions */
-	m = Py_InitModule("binascii", binascii_module_methods);
+	m = Py_InitModule3("binascii", binascii_module_methods, doc_binascii);
 	if (m == NULL)
 		return;
 
 	d = PyModule_GetDict(m);
-	x = PyString_FromString(doc_binascii);
-	PyDict_SetItemString(d, "__doc__", x);
-	Py_XDECREF(x);
 
 	Error = PyErr_NewException("binascii.Error", PyExc_ValueError, NULL);
 	PyDict_SetItemString(d, "Error", Error);


More information about the Python-3000-checkins mailing list