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