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
e36fcde3
Kaydet (Commit)
e36fcde3
authored
Kas 14, 2014
tarafından
Guido van Rossum
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
- Issue #22841: Reject coroutines in asyncio add_signal_handler().
Patch by Ludovic.Gasc.
üst
6c14f231
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
0 deletions
+18
-0
unix_events.py
Lib/asyncio/unix_events.py
+3
-0
test_unix_events.py
Lib/test/test_asyncio/test_unix_events.py
+12
-0
NEWS
Misc/NEWS
+3
-0
No files found.
Lib/asyncio/unix_events.py
Dosyayı görüntüle @
e36fcde3
...
...
@@ -13,6 +13,7 @@ import threading
from
.
import
base_events
from
.
import
base_subprocess
from
.
import
constants
from
.
import
coroutines
from
.
import
events
from
.
import
selector_events
from
.
import
selectors
...
...
@@ -66,6 +67,8 @@ class _UnixSelectorEventLoop(selector_events.BaseSelectorEventLoop):
Raise ValueError if the signal number is invalid or uncatchable.
Raise RuntimeError if there is a problem setting up the handler.
"""
if
coroutines
.
iscoroutinefunction
(
callback
):
raise
TypeError
(
"coroutines cannot be used with call_soon()"
)
self
.
_check_signal
(
sig
)
try
:
# set_wakeup_fd() raises ValueError if this is not the
...
...
Lib/test/test_asyncio/test_unix_events.py
Dosyayı görüntüle @
e36fcde3
...
...
@@ -63,6 +63,18 @@ class SelectorEventLoopSignalTests(test_utils.TestCase):
self
.
loop
.
add_signal_handler
,
signal
.
SIGINT
,
lambda
:
True
)
@mock.patch
(
'asyncio.unix_events.signal'
)
def
test_add_signal_handler_coroutine_error
(
self
,
m_signal
):
@asyncio.coroutine
def
simple_coroutine
():
yield
from
[]
self
.
assertRaises
(
TypeError
,
self
.
loop
.
add_signal_handler
,
signal
.
SIGINT
,
simple_coroutine
)
@mock.patch
(
'asyncio.unix_events.signal'
)
def
test_add_signal_handler
(
self
,
m_signal
):
m_signal
.
NSIG
=
signal
.
NSIG
...
...
Misc/NEWS
Dosyayı görüntüle @
e36fcde3
...
...
@@ -36,6 +36,9 @@ Core and Builtins
Library
-------
- Issue #22841: Reject coroutines in asyncio add_signal_handler().
Patch by Ludovic.Gasc.
- Issue #22849: Fix possible double free in the io.TextIOWrapper constructor.
- Issue #12728: Different Unicode characters having the same uppercase but
...
...
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