[Python-checkins] CVS: python/dist/src/Modules socketmodule.c,1.160,1.161

Martin v. L?wis loewis@users.sourceforge.net
Sat, 04 Aug 2001 15:32:05 -0700


Update of /cvsroot/python/python/dist/src/Modules
In directory usw-pr-cvs1:/tmp/cvs-serv26827/Modules

Modified Files:
	socketmodule.c 
Log Message:
Auto-detect hstrerror. Raise socket.herror in PyH_Error. Register the three
exception classes in the module dictionary.


Index: socketmodule.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Modules/socketmodule.c,v
retrieving revision 1.160
retrieving revision 1.161
diff -C2 -d -r1.160 -r1.161
*** socketmodule.c	2001/08/03 10:02:29	1.160
--- socketmodule.c	2001/08/04 22:32:03	1.161
***************
*** 432,436 ****
  #endif
  	if (v != NULL) {
! 		PyErr_SetObject(PyGAI_Error, v);
  		Py_DECREF(v);
  	}
--- 432,436 ----
  #endif
  	if (v != NULL) {
! 		PyErr_SetObject(PyH_Error, v);
  		Py_DECREF(v);
  	}
***************
*** 2916,2926 ****
--- 2916,2929 ----
  	if (PySocket_Error == NULL)
  		return;
+ 	PyDict_SetItemString(d, "error", PySocket_Error);
  	PyH_Error = PyErr_NewException("socket.herror", PySocket_Error, NULL);
  	if (PyH_Error == NULL)
  		return;
+ 	PyDict_SetItemString(d, "herror", PyH_Error);
  	PyGAI_Error = PyErr_NewException("socket.gaierror", PySocket_Error,
  	    NULL);
  	if (PyGAI_Error == NULL)
  		return;
+ 	PyDict_SetItemString(d, "gaierror", PyGAI_Error);
  #ifdef USE_SSL
  	SSL_load_error_strings();
***************
*** 2935,2939 ****
  		return;
  #endif /* USE_SSL */
- 	PyDict_SetItemString(d, "error", PySocket_Error);
  	PySocketSock_Type.ob_type = &PyType_Type;
  	PySocketSock_Type.tp_doc = sockettype_doc;
--- 2938,2941 ----