[Python-checkins] cpython (3.5): Issue #21382: Clarify signal.signal() documentation on Windows

berker.peksag python-checkins at python.org
Sat Apr 23 19:59:26 EDT 2016


https://hg.python.org/cpython/rev/1fcf68e6f4c7
changeset: 101106:1fcf68e6f4c7
branch: 3.5
parent: 101103:a912ca4f507b
user: Berker Peksag <berker.peksag at gmail.com>
date: Sun Apr 24 02:59:16 2016 +0300
summary:
 Issue #21382: Clarify signal.signal() documentation on Windows
All signal.SIG* constants may not be defined on Windows so a call like
 signal.signal(signal.SIGPIPE, lambda signum, frame: sys.exit(1))
will raise an AttributeError.
files:
 Doc/library/signal.rst | 3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/Doc/library/signal.rst b/Doc/library/signal.rst
--- a/Doc/library/signal.rst
+++ b/Doc/library/signal.rst
@@ -351,6 +351,9 @@
 On Windows, :func:`signal` can only be called with :const:`SIGABRT`,
 :const:`SIGFPE`, :const:`SIGILL`, :const:`SIGINT`, :const:`SIGSEGV`, or
 :const:`SIGTERM`. A :exc:`ValueError` will be raised in any other case.
+ Note that not all systems define the same set of signal names; an
+ :exc:`AttributeError` will be raised if a signal name is not defined as
+ ``SIG*`` module level constant.
 
 
 .. function:: sigpending()
-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /