@@ -53,7 +53,7 @@ weekday_to_int = {int_to_weekday[key]: key for key in int_to_weekday}
5353
5454@ cython.wraparound (False )
5555@ cython.boundscheck (False )
56- cpdef int32_t get_days_in_month(int year, Py_ssize_t month) nogil:
56+ cpdef int32_t get_days_in_month(int year, Py_ssize_t month) noexcept nogil:
5757 """
5858 Return the number of days in the given month of the given year.
5959
@@ -77,7 +77,7 @@ cpdef int32_t get_days_in_month(int year, Py_ssize_t month) nogil:
7777@ cython.wraparound (False )
7878@ cython.boundscheck (False )
7979@cython.cdivision
80- cdef int dayofweek(int y, int m, int d) nogil:
80+ cdef int dayofweek(int y, int m, int d) noexcept nogil:
8181 """
8282 Find the day of week for the date described by the Y/M/D triple y, m, d
8383 using Sakamoto's method, from wikipedia.
@@ -114,7 +114,7 @@ cdef int dayofweek(int y, int m, int d) nogil:
114114 return (day + 6 ) % 7
115115
116116
117- cdef bint is_leapyear(int64_t year) nogil:
117+ cdef bint is_leapyear(int64_t year) noexcept nogil:
118118 """
119119 Returns 1 if the given year is a leap year, 0 otherwise.
120120
@@ -132,7 +132,7 @@ cdef bint is_leapyear(int64_t year) nogil:
132132
133133@ cython.wraparound (False )
134134@ cython.boundscheck (False )
135- cpdef int32_t get_week_of_year(int year, int month, int day) nogil:
135+ cpdef int32_t get_week_of_year(int year, int month, int day) noexcept nogil:
136136 """
137137 Return the ordinal week-of-year for the given day.
138138
@@ -155,7 +155,7 @@ cpdef int32_t get_week_of_year(int year, int month, int day) nogil:
155155
156156@ cython.wraparound (False )
157157@ cython.boundscheck (False )
158- cpdef iso_calendar_t get_iso_calendar(int year, int month, int day) nogil:
158+ cpdef iso_calendar_t get_iso_calendar(int year, int month, int day) noexcept nogil:
159159 """
160160 Return the year, week, and day of year corresponding to ISO 8601
161161
@@ -209,7 +209,7 @@ cpdef iso_calendar_t get_iso_calendar(int year, int month, int day) nogil:
209209
210210@ cython.wraparound (False )
211211@ cython.boundscheck (False )
212- cpdef int32_t get_day_of_year(int year, int month, int day) nogil:
212+ cpdef int32_t get_day_of_year(int year, int month, int day) noexcept nogil:
213213 """
214214 Return the ordinal day-of-year for the given day.
215215
@@ -243,7 +243,7 @@ cpdef int32_t get_day_of_year(int year, int month, int day) nogil:
243243# ---------------------------------------------------------------------
244244# Business Helpers
245245
246- cpdef int get_lastbday(int year, int month) nogil:
246+ cpdef int get_lastbday(int year, int month) noexcept nogil:
247247 """
248248 Find the last day of the month that is a business day.
249249
@@ -264,7 +264,7 @@ cpdef int get_lastbday(int year, int month) nogil:
264264 return days_in_month - max (((wkday + days_in_month - 1 ) % 7 ) - 4 , 0 )
265265
266266
267- cpdef int get_firstbday(int year, int month) nogil:
267+ cpdef int get_firstbday(int year, int month) noexcept nogil:
268268 """
269269 Find the first day of the month that is a business day.
270270
0 commit comments