Commit 11360103 authored by Jason Madden's avatar Jason Madden

The cython extension should stop itself when closed too.

parent 2cfffde3
......@@ -342,6 +342,7 @@ class watcher(object):
def _watcher_set_data(self, the_watcher, data):
# This abstraction exists for the sole benefit of
# libuv.watcher.stat, which "subclasses" uv_handle_t.
# Can we do something to avoid this extra function call?
the_watcher.data = data
return data
......
......@@ -794,7 +794,7 @@ cdef public class watcher [object PyGeventWatcherObject, type PyGeventWatcher_Ty
return ''
def close(self):
pass
self.stop()
def __enter__(self):
return self
......
......@@ -206,10 +206,10 @@ class TestWait(greentest.TestCase):
else:
expected_len = min(max_len, self.timeout / self.period)
if self.count is None:
assert sender.ready()
self.assertTrue(sender.ready(), sender)
else:
expected_len = min(self.count, expected_len)
assert not sender.ready()
self.assertFalse(sender.ready(), sender)
sender.kill()
self.assertEqual(expected_len, len(results), (expected_len, len(results), results))
......
......@@ -27,7 +27,6 @@ class Test(greentest.TestCase):
def _do_test_del(self, pipe, **kwargs):
r, w = pipe
s = FileObject(w, 'wb', **kwargs)
ts = type(s)
s.write(b'x')
try:
s.flush()
......
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