diff --git a/Doc/library/calendar.rst b/Doc/library/calendar.rst index 54cafaf4fe47d8..a412f7652a336b 100644 --- a/Doc/library/calendar.rst +++ b/Doc/library/calendar.rst @@ -580,8 +580,11 @@ The :mod:`!calendar` module defines the following exceptions: .. exception:: IllegalMonthError(month) - A subclass of :exc:`ValueError`, + A subclass of both :exc:`ValueError` and :exc:`IndexError`, raised when the given month number is outside of the range 1-12 (inclusive). + The :exc:`IndexError` base class is preserved for backwards compatibility + with code that caught :exc:`IndexError` for bad month numbers prior to + Python 3.13. .. attribute:: month diff --git a/Misc/NEWS.d/next/Documentation/2026-04-17-02-28-55.gh-issue-148663.MHIbRB.rst b/Misc/NEWS.d/next/Documentation/2026-04-17-02-28-55.gh-issue-148663.MHIbRB.rst new file mode 100644 index 00000000000000..fa95447fb4ae20 --- /dev/null +++ b/Misc/NEWS.d/next/Documentation/2026-04-17-02-28-55.gh-issue-148663.MHIbRB.rst @@ -0,0 +1,5 @@ +Document that :class:`calendar.IllegalMonthError` inherits from both +:exc:`ValueError` and :exc:`IndexError`, preserving :exc:`IndexError` for +backwards compatibility with code that caught it for bad month numbers prior +to Python 3.13. +########################################################################### diff --git a/Misc/NEWS.d/next/Documentation/2026-04-18-12-38-41.gh-issue-100557.a6MWvZ.rst b/Misc/NEWS.d/next/Documentation/2026-04-18-12-38-41.gh-issue-100557.a6MWvZ.rst new file mode 100644 index 00000000000000..eac31c915f2fc8 --- /dev/null +++ b/Misc/NEWS.d/next/Documentation/2026-04-18-12-38-41.gh-issue-100557.a6MWvZ.rst @@ -0,0 +1,4 @@ +Clarify the documentation for :func:`signal.pause` to explain that it only +returns when a signal with an installed handler is delivered, not when an +ignored signal arrives. +########################################################################### diff --git a/Modules/clinic/signalmodule.c.h b/Modules/clinic/signalmodule.c.h index 9fd24d15bf2500..b3c09ea8e1e133 100644 --- a/Modules/clinic/signalmodule.c.h +++ b/Modules/clinic/signalmodule.c.h @@ -87,7 +87,11 @@ PyDoc_STRVAR(signal_pause__doc__, "pause($module, /)\n" "--\n" "\n" -"Wait until a signal arrives."); +"Wait until a signal with an installed handler is delivered.\n" +"\n" +"Cause the process to sleep until a signal is received that either\n" +"terminates it or causes it to call a signal-catching function. If the\n" +"signal is being ignored, pause() is not interrupted."); #define SIGNAL_PAUSE_METHODDEF \ {"pause", (PyCFunction)signal_pause, METH_NOARGS, signal_pause__doc__}, diff --git a/Modules/signalmodule.c b/Modules/signalmodule.c index fb548b8ca00f24..4de218d8f69eea 100644 --- a/Modules/signalmodule.c +++ b/Modules/signalmodule.c @@ -395,7 +395,11 @@ signal_alarm_impl(PyObject *module, int seconds) /*[clinic input] signal.pause -Wait until a signal arrives. +Wait until a signal with an installed handler is delivered. + +Cause the process to sleep until a signal is received that either +terminates it or causes it to call a signal-catching function. If the +signal is being ignored, pause() is not interrupted. [clinic start generated code]*/ static PyObject *