Commit 106bdd3b authored by Martin v. Löwis's avatar Martin v. Löwis

Correct __repr__: include module name, avoid extra space for empty status,

use 0x format for id. Proposed by Cesar Eduardo Barros in patch #470680.
parent 9abaf4d3
...@@ -209,7 +209,7 @@ class dispatcher: ...@@ -209,7 +209,7 @@ class dispatcher:
def __repr__ (self): def __repr__ (self):
try: try:
status = [] status = [self.__class__.__module__+"."+self.__class__.__name__]
if self.accepting and self.addr: if self.accepting and self.addr:
status.append ('listening') status.append ('listening')
elif self.connected: elif self.connected:
...@@ -219,8 +219,7 @@ class dispatcher: ...@@ -219,8 +219,7 @@ class dispatcher:
status.append ('%s:%d' % self.addr) status.append ('%s:%d' % self.addr)
else: else:
status.append (self.addr) status.append (self.addr)
return '<%s %s at %x>' % (self.__class__.__name__, return '<%s at %#x>' % (' '.join (status), id (self))
' '.join (status), id (self))
except: except:
pass pass
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment