Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
f007876b
Kaydet (Commit)
f007876b
authored
Nis 07, 2011
tarafından
Brian Quinlan
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #11777: Executor.map does not submit futures until iter.next() is called
üst
0df80926
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
10 deletions
+22
-10
_base.py
Lib/concurrent/futures/_base.py
+13
-9
test_concurrent_futures.py
Lib/test/test_concurrent_futures.py
+9
-1
No files found.
Lib/concurrent/futures/_base.py
Dosyayı görüntüle @
f007876b
...
@@ -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
Dosyayı görüntüle @
f007876b
...
@@ -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