Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gevent
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gevent
Commits
8d4a7b73
Commit
8d4a7b73
authored
Apr 04, 2016
by
Jason Madden
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cherry-picking updates from maister.
parent
7c58df90
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
1 deletion
+20
-1
changelog.rst
changelog.rst
+7
-0
gevent/queue.py
gevent/queue.py
+7
-1
greentest/test__queue.py
greentest/test__queue.py
+6
-0
No files found.
changelog.rst
View file @
8d4a7b73
...
...
@@ -11,6 +11,13 @@
``wait`` to return prematurely. Reported in :issue:`771` by Sergey
Vasilyev.
- 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)
===================
...
...
gevent/queue.py
View file @
8d4a7b73
...
...
@@ -105,6 +105,8 @@ class Queue(object):
return
type
(
self
)(
self
.
maxsize
,
self
.
queue
)
def
_init
(
self
,
maxsize
,
items
=
None
):
# FIXME: Why is maxsize unused or even passed?
# pylint:disable=unused-argument
if
items
:
self
.
queue
=
collections
.
deque
(
items
)
else
:
...
...
@@ -321,7 +323,7 @@ class Queue(object):
try
:
putter
=
self
.
putters
.
popleft
()
self
.
_put
(
putter
.
item
)
except
:
except
:
# pylint:disable=bare-except
putter
.
throw
(
*
sys
.
exc_info
())
else
:
putter
.
switch
(
putter
)
...
...
@@ -378,9 +380,11 @@ class PriorityQueue(Queue):
self
.
queue
=
[]
def
_put
(
self
,
item
,
heappush
=
heapq
.
heappush
):
# pylint:disable=arguments-differ
heappush
(
self
.
queue
,
item
)
def
_get
(
self
,
heappop
=
heapq
.
heappop
):
# pylint:disable=arguments-differ
return
heappop
(
self
.
queue
)
...
...
@@ -593,3 +597,5 @@ class Channel(object):
if
result
is
StopIteration
:
raise
result
return
result
__next__
=
next
# py3
greentest/test__queue.py
View file @
8d4a7b73
...
...
@@ -254,6 +254,12 @@ class TestChannel(TestCase):
channel
.
task_done
()
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
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment