Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
050ce6a4
Commit
050ce6a4
authored
Apr 08, 2011
by
Brian Quinlan
Browse files
Options
Browse Files
Download
Plain Diff
Merge to tip.
parents
c8d6e06f
05b88306
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
10 deletions
+22
-10
Lib/concurrent/futures/_base.py
Lib/concurrent/futures/_base.py
+13
-9
Lib/test/test_concurrent_futures.py
Lib/test/test_concurrent_futures.py
+9
-1
No files found.
Lib/concurrent/futures/_base.py
View file @
050ce6a4
...
@@ -536,15 +536,19 @@ class Executor(object):
...
@@ -536,15 +536,19 @@ class Executor(object):
fs
=
[
self
.
submit
(
fn
,
*
args
)
for
args
in
zip
(
*
iterables
)]
fs
=
[
self
.
submit
(
fn
,
*
args
)
for
args
in
zip
(
*
iterables
)]
try
:
# Yield must be hidden in closure so that the futures are submitted
for
future
in
fs
:
# before the first iterator value is required.
if
timeout
is
None
:
def
result_iterator
():
yield
future
.
result
()
try
:
else
:
for
future
in
fs
:
yield
future
.
result
(
end_time
-
time
.
time
())
if
timeout
is
None
:
finally
:
yield
future
.
result
()
for
future
in
fs
:
else
:
future
.
cancel
()
yield
future
.
result
(
end_time
-
time
.
time
())
finally
:
for
future
in
fs
:
future
.
cancel
()
return
result_iterator
()
def
shutdown
(
self
,
wait
=
True
):
def
shutdown
(
self
,
wait
=
True
):
"""Clean-up the resources associated with the Executor.
"""Clean-up the resources associated with the Executor.
...
...
Lib/test/test_concurrent_futures.py
View file @
050ce6a4
...
@@ -369,7 +369,15 @@ class ExecutorTest(unittest.TestCase):
...
@@ -369,7 +369,15 @@ class ExecutorTest(unittest.TestCase):
class
ThreadPoolExecutorTest
(
ThreadPoolMixin
,
ExecutorTest
):
class
ThreadPoolExecutorTest
(
ThreadPoolMixin
,
ExecutorTest
):
pass
def
test_map_submits_without_iteration
(
self
):
"""Tests verifying issue 11777."""
finished
=
[]
def
record_finished
(
n
):
finished
.
append
(
n
)
self
.
executor
.
map
(
record_finished
,
range
(
10
))
self
.
executor
.
shutdown
(
wait
=
True
)
self
.
assertCountEqual
(
finished
,
range
(
10
))
class
ProcessPoolExecutorTest
(
ProcessPoolMixin
,
ExecutorTest
):
class
ProcessPoolExecutorTest
(
ProcessPoolMixin
,
ExecutorTest
):
...
...
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