Skip to content

Commit b0f0959

Browse files
committed
type swapped_day_and_month
1 parent 7d06940 commit b0f0959

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

pandas/_libs/tslibs/parsing.pyx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,7 @@ cdef inline object _parse_delimited_date(str date_string, bint dayfirst):
149149
Py_ssize_t length
150150
int day = 1, month = 1, year
151151
bint can_swap = 0
152+
bint swapped_day_and_month = 0
152153

153154
buf = get_c_string_buf_and_size(date_string, &length)
154155
if length == 10:
@@ -177,12 +178,12 @@ cdef inline object _parse_delimited_date(str date_string, bint dayfirst):
177178
# date_string can't be converted to date, above format
178179
return None, None
179180

180-
swapped_day_and_month = False
181+
swapped_day_and_month = 0
181182
if 1 <= month <= MAX_DAYS_IN_MONTH and 1 <= day <= MAX_DAYS_IN_MONTH \
182183
and (month <= MAX_MONTH or day <= MAX_MONTH):
183184
if (month > MAX_MONTH or (day <= MAX_MONTH and dayfirst)) and can_swap:
184185
day, month = month, day
185-
swapped_day_and_month = True
186+
swapped_day_and_month = 1
186187
if dayfirst and not swapped_day_and_month:
187188
warnings.warn(
188189
PARSING_WARNING_MSG.format(

0 commit comments

Comments
 (0)