Extract the errno value to use from the errno module if possible.
This commit is contained in:
parent
24ccca1565
commit
70d566be10
|
@ -54,6 +54,11 @@ except ImportError:
|
||||||
|
|
||||||
import os, sys
|
import os, sys
|
||||||
|
|
||||||
|
try:
|
||||||
|
from errno import EBADF
|
||||||
|
except ImportError:
|
||||||
|
EBADF = 9
|
||||||
|
|
||||||
__all__ = ["getfqdn"]
|
__all__ = ["getfqdn"]
|
||||||
__all__.extend(os._get_exports_list(_socket))
|
__all__.extend(os._get_exports_list(_socket))
|
||||||
if _have_ssl:
|
if _have_ssl:
|
||||||
|
@ -137,7 +142,7 @@ _socketmethods = (
|
||||||
class _closedsocket(object):
|
class _closedsocket(object):
|
||||||
__slots__ = []
|
__slots__ = []
|
||||||
def _dummy(*args):
|
def _dummy(*args):
|
||||||
raise error(9, 'Bad file descriptor')
|
raise error(EBADF, 'Bad file descriptor')
|
||||||
send = recv = sendto = recvfrom = __getattr__ = _dummy
|
send = recv = sendto = recvfrom = __getattr__ = _dummy
|
||||||
|
|
||||||
class _socketobject(object):
|
class _socketobject(object):
|
||||||
|
|
Loading…
Reference in New Issue