From: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> Date: Fri, 25 Aug 2023 16:20:38 +0000 (-0700) Subject: [3.12] GH-108202: Document ``calendar`` exceptions (GH-108398) (#108467) X-Git-Tag: v3.12.0rc2~65 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c5448ab6d45452eb976618013514f2eb89d4eea4;p=thirdparty%2FPython%2Fcpython.git [3.12] GH-108202: Document ``calendar`` exceptions (GH-108398) (#108467) GH-108202: Document ``calendar`` exceptions (GH-108398) (cherry picked from commit 135098743a0fae0efbcd98e35458e5bc721702e9) Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com> --- diff --git a/Doc/library/calendar.rst b/Doc/library/calendar.rst index 07d04a1c7b58..3c097f4cf7ab 100644 --- a/Doc/library/calendar.rst +++ b/Doc/library/calendar.rst @@ -469,6 +469,29 @@ The :mod:`calendar` module exports the following data attributes: Aliases for day numbers, where ``MONDAY`` is ``0`` and ``SUNDAY`` is ``6``. + +The :mod:`calendar` module defines the following exceptions: + +.. exception:: IllegalMonthError(month) + + A subclass of :exc:`ValueError`, + raised when the given month number is outside of the range 1-12 (inclusive). + + .. attribute:: month + + The invalid month number. + + +.. exception:: IllegalWeekdayError(weekday) + + A subclass of :exc:`ValueError`, + raised when the given weekday number is outside of the range 0-6 (inclusive). + + .. attribute:: weekday + + The invalid weekday number. + + .. seealso:: Module :mod:`datetime`