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
d8b72e4a
Kaydet (Commit)
d8b72e4a
authored
Mar 03, 2017
tarafından
Yury Selivanov
Kaydeden (comit)
Yury Selivanov
Mar 03, 2017
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
bpo-28963: Fix out of bound iteration in asyncio.Future.remove_done_callback/C (#408)
üst
2ef08d3b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
1 deletion
+33
-1
test_futures.py
Lib/test/test_asyncio/test_futures.py
+29
-0
NEWS
Misc/NEWS
+3
-0
_asynciomodule.c
Modules/_asynciomodule.c
+1
-1
No files found.
Lib/test/test_asyncio/test_futures.py
Dosyayı görüntüle @
d8b72e4a
...
@@ -569,6 +569,35 @@ class BaseFutureDoneCallbackTests():
...
@@ -569,6 +569,35 @@ class BaseFutureDoneCallbackTests():
self
.
assertEqual
(
bag
,
[
2
])
self
.
assertEqual
(
bag
,
[
2
])
self
.
assertEqual
(
f
.
result
(),
'foo'
)
self
.
assertEqual
(
f
.
result
(),
'foo'
)
def
test_remove_done_callbacks_list_mutation
(
self
):
# see http://bugs.python.org/issue28963 for details
fut
=
self
.
_new_future
()
fut
.
add_done_callback
(
str
)
for
_
in
range
(
63
):
fut
.
add_done_callback
(
id
)
class
evil
:
def
__eq__
(
self
,
other
):
fut
.
remove_done_callback
(
id
)
return
False
fut
.
remove_done_callback
(
evil
())
def
test_schedule_callbacks_list_mutation
(
self
):
# see http://bugs.python.org/issue28963 for details
def
mut
(
f
):
f
.
remove_done_callback
(
str
)
fut
=
self
.
_new_future
()
fut
.
add_done_callback
(
mut
)
fut
.
add_done_callback
(
str
)
fut
.
add_done_callback
(
str
)
fut
.
set_result
(
1
)
test_utils
.
run_briefly
(
self
.
loop
)
@unittest.skipUnless
(
hasattr
(
futures
,
'_CFuture'
),
@unittest.skipUnless
(
hasattr
(
futures
,
'_CFuture'
),
'requires the C _asyncio module'
)
'requires the C _asyncio module'
)
...
...
Misc/NEWS
Dosyayı görüntüle @
d8b72e4a
...
@@ -261,6 +261,9 @@ Extension Modules
...
@@ -261,6 +261,9 @@ Extension Modules
Library
Library
-------
-------
- bpo-28963: Fix out of bound iteration in asyncio.Future.remove_done_callback
implemented in C.
- bpo-29704: asyncio.subprocess.SubprocessStreamProtocol no longer closes before
- bpo-29704: asyncio.subprocess.SubprocessStreamProtocol no longer closes before
all pipes are closed.
all pipes are closed.
...
...
Modules/_asynciomodule.c
Dosyayı görüntüle @
d8b72e4a
...
@@ -521,7 +521,7 @@ _asyncio_Future_remove_done_callback(FutureObj *self, PyObject *fn)
...
@@ -521,7 +521,7 @@ _asyncio_Future_remove_done_callback(FutureObj *self, PyObject *fn)
return
NULL
;
return
NULL
;
}
}
for
(
i
=
0
;
i
<
len
;
i
++
)
{
for
(
i
=
0
;
i
<
PyList_GET_SIZE
(
self
->
fut_callbacks
)
;
i
++
)
{
int
ret
;
int
ret
;
PyObject
*
item
=
PyList_GET_ITEM
(
self
->
fut_callbacks
,
i
);
PyObject
*
item
=
PyList_GET_ITEM
(
self
->
fut_callbacks
,
i
);
...
...
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