[Patches] [ python-Patches-470744 ] More cleanup of __repr__ in asyncore

noreply@sourceforge.net noreply@sourceforge.net
Fri, 12 Oct 2001 17:38:58 -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: Open
Resolution: None
Priority: 5
Submitted By: Cesar Eduardo Barros (cesarb)
Assigned to: Nobody/Anonymous (nobody)
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.

----------------------------------------------------------------------

You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=305470&aid=470744&group_id=5470