[Python-checkins] CVS: python/dist/src/Modules termios.c,2.32,2.33
Fred L. Drake
fdrake@users.sourceforge.net
Wed, 13 Feb 2002 23:08:33 -0800
Update of /cvsroot/python/python/dist/src/Modules
In directory usw-pr-cvs1:/tmp/cvs-serv20965/Modules
Modified Files:
termios.c
Log Message:
Use PyModule_AddObject() instead of accessing the module dict directly.
Index: termios.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Modules/termios.c,v
retrieving revision 2.32
retrieving revision 2.33
diff -C2 -d -r2.32 -r2.33
*** termios.c 12 Jan 2002 11:05:08 -0000 2.32
--- termios.c 14 Feb 2002 07:08:31 -0000 2.33
***************
*** 892,896 ****
PyInit_termios(void)
{
! PyObject *m, *d;
struct constant *constant = termios_constants;
--- 892,896 ----
PyInit_termios(void)
{
! PyObject *m;
struct constant *constant = termios_constants;
***************
*** 898,904 ****
(PyObject *)NULL, PYTHON_API_VERSION);
! d = PyModule_GetDict(m);
! TermiosError = PyErr_NewException("termios.error", NULL, NULL);
! PyDict_SetItemString(d, "error", TermiosError);
while (constant->name != NULL) {
--- 898,906 ----
(PyObject *)NULL, PYTHON_API_VERSION);
! if (TermiosError == NULL) {
! TermiosError = PyErr_NewException("termios.error", NULL, NULL);
! }
! Py_INCREF(TermiosError);
! PyModule_AddObject(m, "error", TermiosError);
while (constant->name != NULL) {