]> granicus.if.org Git - python/commitdiff
Auto-detect hstrerror. Raise socket.herror in PyH_Error. Register the three
authorMartin v. Löwis <martin@v.loewis.de>
Sat, 4 Aug 2001 22:32:03 +0000 (22:32 +0000)
committerMartin v. Löwis <martin@v.loewis.de>
Sat, 4 Aug 2001 22:32:03 +0000 (22:32 +0000)
exception classes in the module dictionary.

Modules/socketmodule.c
configure
configure.in
pyconfig.h.in

index e6a9ec82efcf3e6130bac91e2c24cb49ccda283c..41dd2c48e13bab61d85e84c66b02401aa9a9ea4b 100644 (file)
@@ -431,7 +431,7 @@ PyH_Err(int h_error)
        v = Py_BuildValue("(is)", h_error, "host not found");
 #endif
        if (v != NULL) {
-               PyErr_SetObject(PyGAI_Error, v);
+               PyErr_SetObject(PyH_Error, v);
                Py_DECREF(v);
        }
 
@@ -2915,13 +2915,16 @@ init_socket(void)
        PySocket_Error = PyErr_NewException("socket.error", NULL, NULL);
        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();
        SSLeay_add_ssl_algorithms();
@@ -2934,7 +2937,6 @@ init_socket(void)
                                 (PyObject *)&SSL_Type) != 0)
                return;
 #endif /* USE_SSL */
-       PyDict_SetItemString(d, "error", PySocket_Error);
        PySocketSock_Type.ob_type = &PyType_Type;
        PySocketSock_Type.tp_doc = sockettype_doc;
        Py_INCREF(&PySocketSock_Type);
index e1b8bdaeadff0b44752a70e416079eadf03ed94b..c044c69e56c8cde2eda7e513ce3ec7fcf7d90c23 100755 (executable)
--- a/configure
+++ b/configure
@@ -1,6 +1,6 @@
 #! /bin/sh
 
-# From configure.in Revision: 1.236 
+# From configure.in Revision: 1.237 
 
 # Guess values for system-dependent variables and create Makefiles.
 # Generated automatically using autoconf version 2.13 
@@ -4518,7 +4518,7 @@ echo "$ac_t""$DYNLOADFILE" 1>&6
 for ac_func in alarm chown clock confstr ctermid ctermid_r execv \
  flock fork fsync fdatasync fpathconf ftime ftruncate \
  getgroups getlogin getpeername getpid getpwent getwd \
- inet_pton kill link lstat mkfifo mktime mremap \
hstrerror inet_pton kill link lstat mkfifo mktime mremap \
  nice pathconf pause plock poll pthread_init \
  putenv readlink \
  select setegid seteuid setgid \
index 2d163d35722b2bffecce5660c8ee44bc3a63115a..5ec8b442a335349a5f0c9834d0210d3fc3cb94a2 100644 (file)
@@ -1178,7 +1178,7 @@ AC_MSG_RESULT($DYNLOADFILE)
 AC_CHECK_FUNCS(alarm chown clock confstr ctermid ctermid_r execv \
  flock fork fsync fdatasync fpathconf ftime ftruncate \
  getgroups getlogin getpeername getpid getpwent getwd \
- inet_pton kill link lstat mkfifo mktime mremap \
hstrerror inet_pton kill link lstat mkfifo mktime mremap \
  nice pathconf pause plock poll pthread_init \
  putenv readlink \
  select setegid seteuid setgid \
index e1013fe5a14b25277aee12bcae1362a08825e48d..4f46a097a32245ad5705d603b94483dbe9de4d59 100644 (file)
 /* Define if you have the getwd function.  */
 #undef HAVE_GETWD
 
+/* Define if you have the hstrerror function.  */
+#undef HAVE_HSTRERROR
+
 /* Define if you have the hypot function.  */
 #undef HAVE_HYPOT