@@ -1509,7 +1509,7 @@ get_tzinfo_member(PyObject *self)
15091509 * this returns NULL. Else result is returned.
15101510 */
15111511static PyObject *
1512- call_tzinfo_method (PyObject * tzinfo , const char * name , PyObject * tzinfoarg )
1512+ call_tzinfo_method (PyObject * tzinfo , PyObject * name , PyObject * tzinfoarg )
15131513{
15141514 PyObject * offset ;
15151515
@@ -1519,7 +1519,7 @@ call_tzinfo_method(PyObject *tzinfo, const char *name, PyObject *tzinfoarg)
15191519
15201520 if (tzinfo == Py_None )
15211521 Py_RETURN_NONE ;
1522- offset = PyObject_CallMethod (tzinfo , name , "O" , tzinfoarg );
1522+ offset = PyObject_CallMethodOneArg (tzinfo , name , tzinfoarg );
15231523 if (offset == Py_None || offset == NULL )
15241524 return offset ;
15251525 if (PyDelta_Check (offset )) {
@@ -1536,7 +1536,7 @@ call_tzinfo_method(PyObject *tzinfo, const char *name, PyObject *tzinfoarg)
15361536 }
15371537 else {
15381538 PyErr_Format (PyExc_TypeError ,
1539- "tzinfo.%s () must return None or "
1539+ "tzinfo.%U () must return None or "
15401540 "timedelta, not '%.200s'" ,
15411541 name , Py_TYPE (offset )-> tp_name );
15421542 Py_DECREF (offset );
@@ -1557,7 +1557,7 @@ call_tzinfo_method(PyObject *tzinfo, const char *name, PyObject *tzinfoarg)
15571557static PyObject *
15581558call_utcoffset (PyObject * tzinfo , PyObject * tzinfoarg )
15591559{
1560- return call_tzinfo_method (tzinfo , " utcoffset" , tzinfoarg );
1560+ return call_tzinfo_method (tzinfo , & _Py_ID ( utcoffset ) , tzinfoarg );
15611561}
15621562
15631563/* Call tzinfo.dst(tzinfoarg), and extract an integer from the
@@ -1571,7 +1571,7 @@ call_utcoffset(PyObject *tzinfo, PyObject *tzinfoarg)
15711571static PyObject *
15721572call_dst (PyObject * tzinfo , PyObject * tzinfoarg )
15731573{
1574- return call_tzinfo_method (tzinfo , " dst" , tzinfoarg );
1574+ return call_tzinfo_method (tzinfo , & _Py_ID ( dst ) , tzinfoarg );
15751575}
15761576
15771577/* Call tzinfo.tzname(tzinfoarg), and return the result. tzinfo must be
0 commit comments