diff options
author | Alexander Belopolsky <alexander.belopolsky@gmail.com> | 2012-06-22 18:11:58 (GMT) |
---|---|---|
committer | Alexander Belopolsky <alexander.belopolsky@gmail.com> | 2012-06-22 18:11:58 (GMT) |
commit | 878054e97b517538eb9c9be0e01abde019e085ea (patch) | |
tree | 24dae19e9666632e8aa322f5b35d07345b476e26 /Modules/_datetimemodule.c | |
parent | 31227ca5148436ee3e48430814c59fc31876821d (diff) | |
download | cpython-878054e97b517538eb9c9be0e01abde019e085ea.zip cpython-878054e97b517538eb9c9be0e01abde019e085ea.tar.gz cpython-878054e97b517538eb9c9be0e01abde019e085ea.tar.bz2 |
Fixed compiler warnings in datetime_astimezone()
Diffstat (limited to 'Modules/_datetimemodule.c')
-rw-r--r-- | Modules/_datetimemodule.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/Modules/_datetimemodule.c b/Modules/_datetimemodule.c index db6156c..149f573 100644 --- a/Modules/_datetimemodule.c +++ b/Modules/_datetimemodule.c @@ -4754,7 +4754,7 @@ local_timezone(PyDateTime_DateTime *utc_time) return result; } -static PyObject * +static PyDateTime_DateTime * datetime_astimezone(PyDateTime_DateTime *self, PyObject *args, PyObject *kw) { PyDateTime_DateTime *result; @@ -4777,7 +4777,7 @@ datetime_astimezone(PyDateTime_DateTime *self, PyObject *args, PyObject *kw) /* Conversion to self's own time zone is a NOP. */ if (self->tzinfo == tzinfo) { Py_INCREF(self); - return (PyObject *)self; + return self; } /* Convert self to UTC. */ @@ -4814,10 +4814,11 @@ datetime_astimezone(PyDateTime_DateTime *self, PyObject *args, PyObject *kw) Py_DECREF(temp); temp = (PyObject *)result; - result = _PyObject_CallMethodId(tzinfo, &PyId_fromutc, "O", temp); + result = (PyDateTime_DateTime *) + _PyObject_CallMethodId(tzinfo, &PyId_fromutc, "O", temp); Py_DECREF(temp); - return (PyObject *)result; + return result; } static PyObject * |