No need to put connection fields to zero: tp_alloc already did.

This commit is contained in:
Daniele Varrazzo 2010-12-14 19:49:27 +00:00
parent 7b5d80d36d
commit a50a91fc7b
2 changed files with 3 additions and 8 deletions

View File

@ -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,

View File

@ -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);