Commit e15e0d08 authored by Denis Bilenko's avatar Denis Bilenko

Hub: better __repr__

parent 94cbae39
...@@ -295,12 +295,12 @@ class Hub(greenlet): ...@@ -295,12 +295,12 @@ class Hub(greenlet):
self.format_context = _import(self.format_context) self.format_context = _import(self.format_context)
def __repr__(self): def __repr__(self):
args = (self.__class__.__name__, id(self), self.loop) result = '<%s at 0x%x %s' % (self.__class__.__name__, id(self), self.loop._format())
if self._resolver is not None: if self._resolver is not None:
args = args + (self._resolver, ) result += ' resolver=%r' % self._resolver
return '<%s at 0x%x loop=%r resolver=%r>' % args if self._threadpool is not None:
else: result += ' threadpool=%r' % self._threadpool
return '<%s at 0x%x loop=%r>' % args return result + '>'
def handle_error(self, context, type, value, tb): def handle_error(self, context, type, value, tb):
self.print_exception(context, type, value, tb) self.print_exception(context, type, value, tb)
......
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