[Python-checkins] CVS: python/dist/src/Lib/test test_cgi.py,1.4,1.5
Guido van Rossum
gvanrossum@users.sourceforge.net
Wed, 17 Jan 2001 07:08:39 -0800
Update of /cvsroot/python/python/dist/src/Lib/test
In directory usw-pr-cvs1:/tmp/cvs-serv10746
Modified Files:
test_cgi.py
Log Message:
Fix a bizarre typo in the helper class ComparableException: the
__getattr__() method, which clearly (like the other methods) was
intended to pass the __getattr__() call on to the self.err object,
mistakenly returned getattr(self, self.err) rather than
getattr(self.err, attr). Since self.err is not a string, this always
raises a TypeError. Apparently that doesn't bother for the one
attribute for which __getattr__() is actually called ('__coerce__'),
but it broke the rich comparisons stuff that I'm trying to get into
shape, so I'm fixing this now. (I could also simply remove the
__getattr__() method, but fixing it seems more in the spirit of what
the ComparableException class is trying to do.)
Index: test_cgi.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_cgi.py,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -r1.4 -r1.5
*** test_cgi.py 2000/10/23 17:22:07 1.4
--- test_cgi.py 2001/01/17 15:08:37 1.5
***************
*** 32,36 ****
def __getattr__(self, attr):
! return getattr(self, self.err)
def do_test(buf, method):
--- 32,36 ----
def __getattr__(self, attr):
! return getattr(self.err, attr)
def do_test(buf, method):