diff options
author | Daniele Varrazzo <daniele.varrazzo@gmail.com> | 2010-12-14 19:49:27 +0000 |
---|---|---|
committer | Daniele Varrazzo <daniele.varrazzo@gmail.com> | 2010-12-21 04:02:14 +0000 |
commit | a50a91fc7bbce34cca6db5d89cdcb0db7abd3ab6 (patch) | |
tree | 3bbcbfa543708a4aa9c6f2da77678585d8e321dd | |
parent | 7b5d80d36d47bcbd04038844902b5786e656f6f5 (diff) | |
download | psycopg2-a50a91fc7bbce34cca6db5d89cdcb0db7abd3ab6.tar.gz |
No need to put connection fields to zero: tp_alloc already did.
-rw-r--r-- | ChangeLog | 2 | ||||
-rw-r--r-- | psycopg/connection_type.c | 9 |
2 files changed, 3 insertions, 8 deletions
@@ -1,5 +1,7 @@ 2010-12-14 Daniele Varrazzo <daniele.varrazzo@gmail.com> + * psycopg/connection_type.c: No need to put connection fields to zero. + * lib/extensions.py: Improved mapping from PG to Py encodings. * psycopg/psycopgmodule.c: Added a few missing encodings: EUC_CN, diff --git a/psycopg/connection_type.c b/psycopg/connection_type.c index 21e5e8e..7bfdd34 100644 --- a/psycopg/connection_type.c +++ b/psycopg/connection_type.c @@ -849,19 +849,12 @@ connection_setup(connectionObject *self, const char *dsn, long int async) self->dsn = strdup(dsn); self->notice_list = PyList_New(0); self->notifies = PyList_New(0); - self->closed = 0; self->async = async; self->status = CONN_STATUS_SETUP; - self->critical = NULL; - self->async_cursor = NULL; self->async_status = ASYNC_DONE; - self->pgconn = NULL; - self->cancel = NULL; - self->mark = 0; self->string_types = PyDict_New(); self->binary_types = PyDict_New(); - self->notice_pending = NULL; - self->encoding = NULL; + /* other fields have been zeroed by tp_alloc */ pthread_mutex_init(&(self->lock), NULL); |