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
09cc169a
Kaydet (Commit)
09cc169a
authored
Nis 15, 2014
tarafından
Yury Selivanov
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
asyncio.tasks: Make sure CoroWrapper.send proxies one argument correctly
Issue #21209.
üst
809f90f3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
0 deletions
+20
-0
tasks.py
Lib/asyncio/tasks.py
+2
-0
test_tasks.py
Lib/test/test_asyncio/test_tasks.py
+18
-0
No files found.
Lib/asyncio/tasks.py
Dosyayı görüntüle @
09cc169a
...
...
@@ -53,6 +53,8 @@ class CoroWrapper:
# We use `*value` because of a bug in CPythons prior
# to 3.4.1. See issue #21209 and test_yield_from_corowrapper
# for details. This workaround should be removed in 3.5.0.
if
len
(
value
)
==
1
:
value
=
value
[
0
]
return
self
.
gen
.
send
(
value
)
def
throw
(
self
,
exc
):
...
...
Lib/test/test_asyncio/test_tasks.py
Dosyayı görüntüle @
09cc169a
...
...
@@ -1410,6 +1410,24 @@ class TaskTests(unittest.TestCase):
finally
:
asyncio
.
tasks
.
_DEBUG
=
old_debug
def
test_yield_from_corowrapper_send
(
self
):
def
foo
():
a
=
yield
return
a
def
call
(
arg
):
cw
=
asyncio
.
tasks
.
CoroWrapper
(
foo
(),
foo
)
cw
.
send
(
None
)
try
:
cw
.
send
(
arg
)
except
StopIteration
as
ex
:
return
ex
.
args
[
0
]
else
:
raise
AssertionError
(
'StopIteration was expected'
)
self
.
assertEqual
(
call
((
1
,
2
)),
(
1
,
2
))
self
.
assertEqual
(
call
(
'spam'
),
'spam'
)
class
GatherTestsBase
:
...
...
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