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
0de3de6c
Kaydet (Commit)
0de3de6c
authored
Eki 05, 2016
tarafından
Yury Selivanov
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #28371: Deprecate passing asyncio.Handles to run_in_executor.
üst
3e56ff0d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
3 deletions
+11
-3
base_events.py
Lib/asyncio/base_events.py
+3
-0
test_base_events.py
Lib/test/test_asyncio/test_base_events.py
+6
-3
NEWS
Misc/NEWS
+2
-0
No files found.
Lib/asyncio/base_events.py
Dosyayı görüntüle @
0de3de6c
...
...
@@ -605,6 +605,9 @@ class BaseEventLoop(events.AbstractEventLoop):
if
isinstance
(
func
,
events
.
Handle
):
assert
not
args
assert
not
isinstance
(
func
,
events
.
TimerHandle
)
warnings
.
warn
(
"Passing Handle to loop.run_in_executor() is deprecated"
,
DeprecationWarning
)
if
func
.
_cancelled
:
f
=
self
.
create_future
()
f
.
set_result
(
None
)
...
...
Lib/test/test_asyncio/test_base_events.py
Dosyayı görüntüle @
0de3de6c
...
...
@@ -358,7 +358,8 @@ class BaseEventLoopTests(test_utils.TestCase):
h
=
asyncio
.
Handle
(
cb
,
(),
self
.
loop
)
h
.
cancel
()
f
=
self
.
loop
.
run_in_executor
(
None
,
h
)
with
self
.
assertWarnsRegex
(
DeprecationWarning
,
"Passing Handle"
):
f
=
self
.
loop
.
run_in_executor
(
None
,
h
)
self
.
assertIsInstance
(
f
,
asyncio
.
Future
)
self
.
assertTrue
(
f
.
done
())
self
.
assertIsNone
(
f
.
result
())
...
...
@@ -373,12 +374,14 @@ class BaseEventLoopTests(test_utils.TestCase):
self
.
loop
.
set_default_executor
(
executor
)
res
=
self
.
loop
.
run_in_executor
(
None
,
h
)
with
self
.
assertWarnsRegex
(
DeprecationWarning
,
"Passing Handle"
):
res
=
self
.
loop
.
run_in_executor
(
None
,
h
)
self
.
assertIs
(
f
,
res
)
executor
=
mock
.
Mock
()
executor
.
submit
.
return_value
=
f
res
=
self
.
loop
.
run_in_executor
(
executor
,
h
)
with
self
.
assertWarnsRegex
(
DeprecationWarning
,
"Passing Handle"
):
res
=
self
.
loop
.
run_in_executor
(
executor
,
h
)
self
.
assertIs
(
f
,
res
)
self
.
assertTrue
(
executor
.
submit
.
called
)
...
...
Misc/NEWS
Dosyayı görüntüle @
0de3de6c
...
...
@@ -356,6 +356,8 @@ Library
-
Issue
#
28370
:
Speedup
asyncio
.
StreamReader
.
readexactly
.
Patch
by
Коренберг
Марк
.
-
Issue
#
28371
:
Deprecate
passing
asyncio
.
Handles
to
run_in_executor
.
IDLE
----
...
...
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