[Patches] [ python-Patches-470744 ] More cleanup of __repr__ in asyncore
noreply@sourceforge.net
noreply@sourceforge.net
Thu, 18 Oct 2001 04:40:30 -0700
Patches item #470744, was opened at 2001-10-12 17:38
You can respond by visiting:
http://sourceforge.net/tracker/?func=detail&atid=305470&aid=470744&group_id=5470
Category: Library (Lib)
Group: None
>Status: Closed
>Resolution: Accepted
Priority: 5
Submitted By: Cesar Eduardo Barros (cesarb)
Assigned to: Martin v. Löwis (loewis)
Summary: More cleanup of __repr__ in asyncore
Initial Comment:
This patch removes the ugly 'repr failed' special case
in asyncore.dispatcher.__repr__ that happens when
self.addr is invalid.
- Instead of checking if it's a tuple, just go ahead
and catch the TypeError if it isn't (or if it has
strange contents). This also removes the import for types.
- If it isn't a valid tuple, just do a repr on it. It's
probably some alien network protocol with wierd adresses.
- I can't see how self.addr can cause a NameError,
since it's a class attribute. That was probably
historical cruft. Removed.
This complements python-Patches-470680 (Clean output of
__repr__ in asyncore) which was partially commited as 1.22.
This patch is against asyncore.py 1.22.
----------------------------------------------------------------------
>Comment By: Martin v. Löwis (loewis)
Date: 2001-10-18 04:40
Message:
Logged In: YES
user_id=21627
Thanks, applied as asyncore.py 1.23 (with re-indentation).
----------------------------------------------------------------------
You can respond by visiting:
http://sourceforge.net/tracker/?func=detail&atid=305470&aid=470744&group_id=5470