[Python-checkins] python/dist/src/Lib socket.py,1.38,1.39

fdrake@users.sourceforge.net fdrake@users.sourceforge.net
Tue, 29 Apr 2003 12:50:31 -0700


Update of /cvsroot/python/python/dist/src/Lib
In directory sc8-pr-cvs1:/tmp/cvs-serv1895

Modified Files:
	socket.py 
Log Message:
Extract the errno value to use from the errno module if possible.


Index: socket.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/socket.py,v
retrieving revision 1.38
retrieving revision 1.39
diff -C2 -d -r1.38 -r1.39
*** socket.py	29 Apr 2003 19:27:26 -0000	1.38
--- socket.py	29 Apr 2003 19:50:25 -0000	1.39
***************
*** 55,58 ****
--- 55,63 ----
  import os, sys
  
+ try:
+     from errno import EBADF
+ except ImportError:
+     EBADF = 9
+ 
  __all__ = ["getfqdn"]
  __all__.extend(os._get_exports_list(_socket))
***************
*** 138,142 ****
      __slots__ = []
      def _dummy(*args):
!         raise error(9, 'Bad file descriptor')
      send = recv = sendto = recvfrom = __getattr__ = _dummy
  
--- 143,147 ----
      __slots__ = []
      def _dummy(*args):
!         raise error(EBADF, 'Bad file descriptor')
      send = recv = sendto = recvfrom = __getattr__ = _dummy