From 61e3fd0ad3f2a675c53a347eb34937d703419ffc Mon Sep 17 00:00:00 2001 From: Kevin Sheppard Date: Mon, 17 Aug 2020 19:27:45 +0100 Subject: [PATCH] MAINT: Initialize year to silence warning (#35763) Initialize year to silence warning due to subtracting from value that compiler cannot reason must be either initialized or never reached closes #35622 --- pandas/_libs/tslibs/parsing.pyx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pandas/_libs/tslibs/parsing.pyx b/pandas/_libs/tslibs/parsing.pyx index 8429aebbd85b..7478179df3b7 100644 --- a/pandas/_libs/tslibs/parsing.pyx +++ b/pandas/_libs/tslibs/parsing.pyx @@ -381,7 +381,8 @@ cdef inline object _parse_dateabbr_string(object date_string, datetime default, object freq): cdef: object ret - int year, quarter = -1, month, mnum, date_len + # year initialized to prevent compiler warnings + int year = -1, quarter = -1, month, mnum, date_len # special handling for possibilities eg, 2Q2005, 2Q05, 2005Q1, 05Q1 assert isinstance(date_string, str)