diff options
author | Fred Drake <fdrake@acm.org> | 2003-04-29 19:50:25 (GMT) |
---|---|---|
committer | Fred Drake <fdrake@acm.org> | 2003-04-29 19:50:25 (GMT) |
commit | 70d566be10581db010233f08798a637a8201996a (patch) | |
tree | c94b44325e64c2137606f7951281ba376adc9d40 /Lib/socket.py | |
parent | 24ccca156557a64ca0574a2ad384506d246d030b (diff) | |
download | cpython-70d566be10581db010233f08798a637a8201996a.zip cpython-70d566be10581db010233f08798a637a8201996a.tar.gz cpython-70d566be10581db010233f08798a637a8201996a.tar.bz2 |
Extract the errno value to use from the errno module if possible.
Diffstat (limited to 'Lib/socket.py')
-rw-r--r-- | Lib/socket.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/Lib/socket.py b/Lib/socket.py index b9d4049..2ee0796 100644 --- a/Lib/socket.py +++ b/Lib/socket.py @@ -54,6 +54,11 @@ except ImportError: import os, sys +try: + from errno import EBADF +except ImportError: + EBADF = 9 + __all__ = ["getfqdn"] __all__.extend(os._get_exports_list(_socket)) if _have_ssl: @@ -137,7 +142,7 @@ _socketmethods = ( class _closedsocket(object): __slots__ = [] def _dummy(*args): - raise error(9, 'Bad file descriptor') + raise error(EBADF, 'Bad file descriptor') send = recv = sendto = recvfrom = __getattr__ = _dummy class _socketobject(object): |