Commit 619e3d5f authored by Jason Madden's avatar Jason Madden

Calling debug() on a destroyed libuv loop would raise TypeError

TypeError: initializer for ctype 'struct uv_loop_s *' must be a cdata pointer, not NoneType

Now it is safe.
parent 71c29c15
......@@ -397,18 +397,21 @@ class loop(AbstractLoop):
del self._fork_watchers
del self._child_watchers
_HandleState = namedtuple("HandleState",
['handle',
'type',
'watcher',
'ref',
'active',
'closing'])
def debug(self):
"""
Return all the handles that are open and their ref status.
"""
handle_state = namedtuple("HandleState",
['handle',
'type',
'watcher',
'ref',
'active',
'closing'])
if not self.ptr:
return ["Loop has been destroyed"]
handle_state = self._HandleState
handles = []
# XXX: Convert this to a modern callback.
......
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