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