[Python-checkins] CVS: python/dist/src/Lib socket.py,1.12,1.13

Guido van Rossum gvanrossum@users.sourceforge.net
2001年8月18日 14:00:41 -0700


Update of /cvsroot/python/python/dist/src/Lib
In directory usw-pr-cvs1:/tmp/cvs-serv13497
Modified Files:
	socket.py 
Log Message:
Inspired by Greg Stein's proposed simplification of the _closesocket
class, I came up with an even simpler solution: raise the error in
__getattr__().
Index: socket.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/socket.py,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -d -r1.12 -r1.13
*** socket.py	2001年08月18日 01:23:20	1.12
--- socket.py	2001年08月18日 21:00:39	1.13
***************
*** 156,165 ****
 class _closedsocket:
 
! def _bummer(self):
 raise error(9, 'Bad file descriptor')
- 
- _s = "def %s(self, *args): self._bummer()\n\n"
- for _m in _socketmethods:
- exec _s % _m
 
 
--- 156,161 ----
 class _closedsocket:
 
! def __getattr__(self, name):
 raise error(9, 'Bad file descriptor')
 
 

AltStyle によって変換されたページ (->オリジナル) /