From d4f68600776359950c229a3db890f2e8dfa51d06 Mon Sep 17 00:00:00 2001 From: Kevin Sheppard Date: Mon, 17 Aug 2020 10:44:55 +0100 Subject: [PATCH] MAINT: Initialize year to silence warning 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 8429aebbd85b8..7478179df3b75 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)