@@ -103,18 +103,8 @@ _parse_inftz(const char *str, PyObject *curs)
103103 goto exit ;
104104 }
105105
106- #if defined(PYPY_VERSION ) || PY_VERSION_HEX < 0x03070000
107- {
108- PyObject * tzoff ;
109- if (!(tzoff = PyDelta_FromDSU (0 , 0 , 0 ))) { goto exit ; }
110- tzinfo = PyObject_CallFunctionObjArgs (tzinfo_factory , tzoff , NULL );
111- Py_DECREF (tzoff );
112- if (!tzinfo ) { goto exit ; }
113- }
114- #else
115106 tzinfo = PyDateTime_TimeZone_UTC ;
116107 Py_INCREF (tzinfo );
117- #endif
118108
119109 /* m.replace(tzinfo=tzinfo) */
120110 if (!(args = PyTuple_New (0 ))) { goto exit ; }
@@ -178,11 +168,6 @@ _parse_noninftz(const char *str, Py_ssize_t len, PyObject *curs)
178168 appropriate tzinfo object calling the factory */
179169 Dprintf ("typecast_PYDATETIMETZ_cast: UTC offset = %ds" , tzsec );
180170
181- #if PY_VERSION_HEX < 0x03070000
182- /* Before Python 3.7 the timezone offset had to be a whole number
183- * of minutes, so round the seconds to the closest minute */
184- tzsec = 60 * (int )round (tzsec / 60.0 );
185- #endif
186171 if (!(tzoff = PyDelta_FromDSU (0 , tzsec , 0 ))) { goto exit ; }
187172 if (!(tzinfo = PyObject_CallFunctionObjArgs (
188173 tzinfo_factory , tzoff , NULL ))) {
@@ -270,11 +255,6 @@ typecast_PYTIME_cast(const char *str, Py_ssize_t len, PyObject *curs)
270255 appropriate tzinfo object calling the factory */
271256 Dprintf ("typecast_PYTIME_cast: UTC offset = %ds" , tzsec );
272257
273- #if PY_VERSION_HEX < 0x03070000
274- /* Before Python 3.7 the timezone offset had to be a whole number
275- * of minutes, so round the seconds to the closest minute */
276- tzsec = 60 * (int )round (tzsec / 60.0 );
277- #endif
278258 if (!(tzoff = PyDelta_FromDSU (0 , tzsec , 0 ))) { goto exit ; }
279259 if (!(tzinfo = PyObject_CallFunctionObjArgs (tzinfo_factory , tzoff , NULL ))) {
280260 goto exit ;
0 commit comments