Commit 4d4816a9 authored by Denis Bilenko's avatar Denis Bilenko

avoid gc cycle

parent 9dbbb564
...@@ -208,7 +208,6 @@ class Hub(greenlet): ...@@ -208,7 +208,6 @@ class Hub(greenlet):
default = get_ident() == MAIN_THREAD default = get_ident() == MAIN_THREAD
loop_class = _import(self.loop_class) loop_class = _import(self.loop_class)
self.loop = loop_class(flags=loop, default=default) self.loop = loop_class(flags=loop, default=default)
self.loop.error_handler = self
self._resolver = None self._resolver = None
self.pformat = _import(self.pformat) self.pformat = _import(self.pformat)
...@@ -269,6 +268,7 @@ class Hub(greenlet): ...@@ -269,6 +268,7 @@ class Hub(greenlet):
global _threadlocal global _threadlocal
assert self is getcurrent(), 'Do not call Hub.run() directly' assert self is getcurrent(), 'Do not call Hub.run() directly'
try: try:
self.loop.error_handler = self
self.loop.run() self.loop.run()
finally: finally:
if _threadlocal.__dict__.get('hub') is self: if _threadlocal.__dict__.get('hub') is self:
......
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