Commit 8d4a7b73 authored by Jason Madden's avatar Jason Madden

cherry-picking updates from maister.

parent 7c58df90
...@@ -11,6 +11,13 @@ ...@@ -11,6 +11,13 @@
``wait`` to return prematurely. Reported in :issue:`771` by Sergey ``wait`` to return prematurely. Reported in :issue:`771` by Sergey
Vasilyev. Vasilyev.
- Fix build on Solaris 10. Reported in :issue:`777` by wiggin15. - Fix build on Solaris 10. Reported in :issue:`777` by wiggin15.
- The ``ref`` parameter to :func:`gevent.os.fork_and_watch` was being ignored.
- Python 3: :class:`gevent.queue.Channel` is now correctly iterable, instead of
raising a :exc:`TypeError`.
- Python 3: Add support for :meth:`socket.socket.sendmsg`,
:meth:`socket.socket.recvmsg` and :meth:`socket.socket.recvmsg_into`
on platforms where they are defined. Initial :pr:`773` by Jakub
Klama.
1.1.0 (Mar 5, 2016) 1.1.0 (Mar 5, 2016)
=================== ===================
......
...@@ -105,6 +105,8 @@ class Queue(object): ...@@ -105,6 +105,8 @@ class Queue(object):
return type(self)(self.maxsize, self.queue) return type(self)(self.maxsize, self.queue)
def _init(self, maxsize, items=None): def _init(self, maxsize, items=None):
# FIXME: Why is maxsize unused or even passed?
# pylint:disable=unused-argument
if items: if items:
self.queue = collections.deque(items) self.queue = collections.deque(items)
else: else:
...@@ -321,7 +323,7 @@ class Queue(object): ...@@ -321,7 +323,7 @@ class Queue(object):
try: try:
putter = self.putters.popleft() putter = self.putters.popleft()
self._put(putter.item) self._put(putter.item)
except: except: # pylint:disable=bare-except
putter.throw(*sys.exc_info()) putter.throw(*sys.exc_info())
else: else:
putter.switch(putter) putter.switch(putter)
...@@ -378,9 +380,11 @@ class PriorityQueue(Queue): ...@@ -378,9 +380,11 @@ class PriorityQueue(Queue):
self.queue = [] self.queue = []
def _put(self, item, heappush=heapq.heappush): def _put(self, item, heappush=heapq.heappush):
# pylint:disable=arguments-differ
heappush(self.queue, item) heappush(self.queue, item)
def _get(self, heappop=heapq.heappop): def _get(self, heappop=heapq.heappop):
# pylint:disable=arguments-differ
return heappop(self.queue) return heappop(self.queue)
...@@ -593,3 +597,5 @@ class Channel(object): ...@@ -593,3 +597,5 @@ class Channel(object):
if result is StopIteration: if result is StopIteration:
raise result raise result
return result return result
__next__ = next # py3
...@@ -254,6 +254,12 @@ class TestChannel(TestCase): ...@@ -254,6 +254,12 @@ class TestChannel(TestCase):
channel.task_done() channel.task_done()
assert channel.unfinished_tasks == 0, channel.unfinished_tasks assert channel.unfinished_tasks == 0, channel.unfinished_tasks
def test_iterable(self):
channel = queue.Channel()
gevent.spawn(channel.put, StopIteration)
r = list(channel)
self.assertEqual(r, [])
class TestNoWait(TestCase): class TestNoWait(TestCase):
......
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