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
28cba07d
Commit
28cba07d
authored
Nov 10, 2017
by
Ron Rothman
Committed by
Jason Madden
Nov 10, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
raise PoolFull, not Timeout
parent
d4b00714
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
5 deletions
+5
-5
src/gevent/pool.py
src/gevent/pool.py
+4
-4
src/greentest/test__pool.py
src/greentest/test__pool.py
+1
-1
No files found.
src/gevent/pool.py
View file @
28cba07d
...
@@ -734,8 +734,8 @@ class Pool(Group):
...
@@ -734,8 +734,8 @@ class Pool(Group):
:keyword float timeout: The maximum number of seconds this method will
:keyword float timeout: The maximum number of seconds this method will
block, if ``blocking`` is True. (Ignored if ``blocking`` is False.)
block, if ``blocking`` is True. (Ignored if ``blocking`` is False.)
Raises `
`Timeout`` on timeout, or `PoolFull` if ``blocking`` is False and
Raises `
PoolFull` if either ``blocking`` is False and the pool was full,
the pool is full
.
or if ``blocking`` is True and ``timeout`` was exceeded
.
.. seealso:: :meth:`Group.add`
.. seealso:: :meth:`Group.add`
...
@@ -745,8 +745,8 @@ class Pool(Group):
...
@@ -745,8 +745,8 @@ class Pool(Group):
if
not
self
.
_semaphore
.
acquire
(
blocking
=
blocking
,
timeout
=
timeout
):
if
not
self
.
_semaphore
.
acquire
(
blocking
=
blocking
,
timeout
=
timeout
):
# We failed to acquire the semaphore.
# We failed to acquire the semaphore.
# If blocking was True, then there was a timeout. If blocking was
# If blocking was True, then there was a timeout. If blocking was
# False, then there was no capacity.
# False, then there was no capacity.
Either way, raise PoolFull.
raise
Timeout
()
if
blocking
else
PoolFull
()
raise
PoolFull
()
try
:
try
:
Group
.
add
(
self
,
greenlet
)
Group
.
add
(
self
,
greenlet
)
...
...
src/greentest/test__pool.py
View file @
28cba07d
...
@@ -226,7 +226,7 @@ class PoolBasicTests(greentest.TestCase):
...
@@ -226,7 +226,7 @@ class PoolBasicTests(greentest.TestCase):
second
=
gevent
.
spawn
(
gevent
.
sleep
,
1000
)
second
=
gevent
.
spawn
(
gevent
.
sleep
,
1000
)
try
:
try
:
p
.
add
(
first
)
p
.
add
(
first
)
with
self
.
assertRaises
(
Timeout
):
with
self
.
assertRaises
(
pool
.
PoolFull
):
p
.
add
(
second
,
timeout
=
0.100
)
p
.
add
(
second
,
timeout
=
0.100
)
finally
:
finally
:
second
.
kill
()
second
.
kill
()
...
...
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