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
f85581f6
Kaydet (Commit)
f85581f6
authored
Tem 16, 2014
tarafından
Victor Stinner
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Sade Fark
(Merge 3.4) Issue #21163: Fix "destroy pending task" warning in test_wait_errors()
üst
845212af
e931f7b7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
6 deletions
+9
-6
tasks.py
Lib/asyncio/tasks.py
+2
-2
test_tasks.py
Lib/test/test_asyncio/test_tasks.py
+7
-4
No files found.
Lib/asyncio/tasks.py
Dosyayı görüntüle @
f85581f6
...
...
@@ -330,14 +330,14 @@ def wait(fs, *, loop=None, timeout=None, return_when=ALL_COMPLETED):
raise
TypeError
(
"expect a list of futures, not
%
s"
%
type
(
fs
)
.
__name__
)
if
not
fs
:
raise
ValueError
(
'Set of coroutines/Futures is empty.'
)
if
return_when
not
in
(
FIRST_COMPLETED
,
FIRST_EXCEPTION
,
ALL_COMPLETED
):
raise
ValueError
(
'Invalid return_when value: {}'
.
format
(
return_when
))
if
loop
is
None
:
loop
=
events
.
get_event_loop
()
fs
=
{
async
(
f
,
loop
=
loop
)
for
f
in
set
(
fs
)}
if
return_when
not
in
(
FIRST_COMPLETED
,
FIRST_EXCEPTION
,
ALL_COMPLETED
):
raise
ValueError
(
'Invalid return_when value: {}'
.
format
(
return_when
))
return
(
yield
from
_wait
(
fs
,
timeout
,
return_when
,
loop
))
...
...
Lib/test/test_asyncio/test_tasks.py
Dosyayı görüntüle @
f85581f6
...
...
@@ -623,10 +623,13 @@ class TaskTests(test_utils.TestCase):
ValueError
,
self
.
loop
.
run_until_complete
,
asyncio
.
wait
(
set
(),
loop
=
self
.
loop
))
self
.
assertRaises
(
ValueError
,
self
.
loop
.
run_until_complete
,
asyncio
.
wait
([
asyncio
.
sleep
(
10.0
,
loop
=
self
.
loop
)],
return_when
=-
1
,
loop
=
self
.
loop
))
# -1 is an invalid return_when value
sleep_coro
=
asyncio
.
sleep
(
10.0
,
loop
=
self
.
loop
)
wait_coro
=
asyncio
.
wait
([
sleep_coro
],
return_when
=-
1
,
loop
=
self
.
loop
)
self
.
assertRaises
(
ValueError
,
self
.
loop
.
run_until_complete
,
wait_coro
)
sleep_coro
.
close
()
def
test_wait_first_completed
(
self
):
...
...
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