@@ -53,7 +53,7 @@ weekday_to_int = {int_to_weekday[key]: key for key in int_to_weekday}
53
53
54
54
@ cython.wraparound (False )
55
55
@ 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:
57
57
"""
58
58
Return the number of days in the given month of the given year.
59
59
@@ -77,7 +77,7 @@ cpdef int32_t get_days_in_month(int year, Py_ssize_t month) nogil:
77
77
@ cython.wraparound (False )
78
78
@ cython.boundscheck (False )
79
79
@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:
81
81
"""
82
82
Find the day of week for the date described by the Y/M/D triple y, m, d
83
83
using Sakamoto's method, from wikipedia.
@@ -114,7 +114,7 @@ cdef int dayofweek(int y, int m, int d) nogil:
114
114
return (day + 6 ) % 7
115
115
116
116
117
- cdef bint is_leapyear(int64_t year) nogil:
117
+ cdef bint is_leapyear(int64_t year) noexcept nogil:
118
118
"""
119
119
Returns 1 if the given year is a leap year, 0 otherwise.
120
120
@@ -132,7 +132,7 @@ cdef bint is_leapyear(int64_t year) nogil:
132
132
133
133
@ cython.wraparound (False )
134
134
@ 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:
136
136
"""
137
137
Return the ordinal week-of-year for the given day.
138
138
@@ -155,7 +155,7 @@ cpdef int32_t get_week_of_year(int year, int month, int day) nogil:
155
155
156
156
@ cython.wraparound (False )
157
157
@ 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:
159
159
"""
160
160
Return the year, week, and day of year corresponding to ISO 8601
161
161
@@ -209,7 +209,7 @@ cpdef iso_calendar_t get_iso_calendar(int year, int month, int day) nogil:
209
209
210
210
@ cython.wraparound (False )
211
211
@ 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:
213
213
"""
214
214
Return the ordinal day-of-year for the given day.
215
215
@@ -243,7 +243,7 @@ cpdef int32_t get_day_of_year(int year, int month, int day) nogil:
243
243
# ---------------------------------------------------------------------
244
244
# Business Helpers
245
245
246
- cpdef int get_lastbday(int year, int month) nogil:
246
+ cpdef int get_lastbday(int year, int month) noexcept nogil:
247
247
"""
248
248
Find the last day of the month that is a business day.
249
249
@@ -264,7 +264,7 @@ cpdef int get_lastbday(int year, int month) nogil:
264
264
return days_in_month - max (((wkday + days_in_month - 1 ) % 7 ) - 4 , 0 )
265
265
266
266
267
- cpdef int get_firstbday(int year, int month) nogil:
267
+ cpdef int get_firstbday(int year, int month) noexcept nogil:
268
268
"""
269
269
Find the first day of the month that is a business day.
270
270
0 commit comments