diff options
author | Jason Erickson <jerickso@stickpeople.com> | 2010-05-16 15:20:22 -0600 |
---|---|---|
committer | Federico Di Gregorio <fog@initd.org> | 2010-05-17 09:06:14 +0200 |
commit | 1f1133b8714d1f6e5da656eddb3c6ff62f5e3570 (patch) | |
tree | 7bcf1301765ce5c362fa174c61c1d8b975312998 /psycopg/adapter_datetime.c | |
parent | e286970b625095334ce14a8c0a8a857f914ab53d (diff) | |
download | psycopg2-1f1133b8714d1f6e5da656eddb3c6ff62f5e3570.tar.gz |
Micrsoft Visual C Compile Fix
Moved the declarations of variables/pointers to the beginning of the block, where MSVC wants them.
Diffstat (limited to 'psycopg/adapter_datetime.c')
-rw-r--r-- | psycopg/adapter_datetime.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/psycopg/adapter_datetime.c b/psycopg/adapter_datetime.c index 8d5aa3d..5f7327b 100644 --- a/psycopg/adapter_datetime.c +++ b/psycopg/adapter_datetime.c @@ -56,6 +56,8 @@ extern HIDDEN PyObject *pyPsycopgTzLOCAL; static PyObject * pydatetime_str(pydatetimeObject *self) { + PyObject *res = NULL; + PyObject *iso; if (self->type <= PSYCO_DATETIME_TIMESTAMP) { PyObject *tz; @@ -76,8 +78,7 @@ pydatetime_str(pydatetimeObject *self) break; } - PyObject *res = NULL; - PyObject *iso = PyObject_CallMethod(self->wrapped, "isoformat", NULL); + iso = PyObject_CallMethod(self->wrapped, "isoformat", NULL); if (iso) { res = PyString_FromFormat(fmt, PyString_AsString(iso)); Py_DECREF(iso); |