_PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(updates));
_PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(uri));
_PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(usedforsecurity));
+ _PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(utcoffset));
_PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(value));
_PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(values));
_PyStaticObject_CheckRefcnt((PyObject *)&_Py_ID(version));
_PyUnicode_InternStatic(interp, &string);
assert(_PyUnicode_CheckConsistency(string, 1));
assert(PyUnicode_GET_LENGTH(string) != 1);
+ string = &_Py_ID(utcoffset);
+ _PyUnicode_InternStatic(interp, &string);
+ assert(_PyUnicode_CheckConsistency(string, 1));
+ assert(PyUnicode_GET_LENGTH(string) != 1);
string = &_Py_ID(value);
_PyUnicode_InternStatic(interp, &string);
assert(_PyUnicode_CheckConsistency(string, 1));
* this returns NULL. Else result is returned.
*/
static PyObject *
-call_tzinfo_method(PyObject *tzinfo, const char *name, PyObject *tzinfoarg)
+call_tzinfo_method(PyObject *tzinfo, PyObject *name, PyObject *tzinfoarg)
{
PyObject *offset;
if (tzinfo == Py_None)
Py_RETURN_NONE;
- offset = PyObject_CallMethod(tzinfo, name, "O", tzinfoarg);
+ offset = PyObject_CallMethodOneArg(tzinfo, name, tzinfoarg);
if (offset == Py_None || offset == NULL)
return offset;
if (PyDelta_Check(offset)) {
}
else {
PyErr_Format(PyExc_TypeError,
- "tzinfo.%s() must return None or "
+ "tzinfo.%U() must return None or "
"timedelta, not '%.200s'",
name, Py_TYPE(offset)->tp_name);
Py_DECREF(offset);
static PyObject *
call_utcoffset(PyObject *tzinfo, PyObject *tzinfoarg)
{
- return call_tzinfo_method(tzinfo, "utcoffset", tzinfoarg);
+ return call_tzinfo_method(tzinfo, &_Py_ID(utcoffset), tzinfoarg);
}
/* Call tzinfo.dst(tzinfoarg), and extract an integer from the
static PyObject *
call_dst(PyObject *tzinfo, PyObject *tzinfoarg)
{
- return call_tzinfo_method(tzinfo, "dst", tzinfoarg);
+ return call_tzinfo_method(tzinfo, &_Py_ID(dst), tzinfoarg);
}
/* Call tzinfo.tzname(tzinfoarg), and return the result. tzinfo must be