mirror of
https://github.com/PyMySQL/mysqlclient.git
synced 2025-08-15 11:10:58 +08:00
@ -446,6 +446,7 @@ _mysql_ConnectionObject_Initialize(
|
|||||||
|
|
||||||
Py_BEGIN_ALLOW_THREADS ;
|
Py_BEGIN_ALLOW_THREADS ;
|
||||||
conn = mysql_init(&(self->connection));
|
conn = mysql_init(&(self->connection));
|
||||||
|
self->open = 1;
|
||||||
if (connect_timeout) {
|
if (connect_timeout) {
|
||||||
unsigned int timeout = connect_timeout;
|
unsigned int timeout = connect_timeout;
|
||||||
mysql_options(&(self->connection), MYSQL_OPT_CONNECT_TIMEOUT,
|
mysql_options(&(self->connection), MYSQL_OPT_CONNECT_TIMEOUT,
|
||||||
@ -496,6 +497,7 @@ _mysql_ConnectionObject_Initialize(
|
|||||||
|
|
||||||
if (!conn) {
|
if (!conn) {
|
||||||
_mysql_Exception(self);
|
_mysql_Exception(self);
|
||||||
|
self->open = 0;
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -515,7 +517,6 @@ _mysql_ConnectionObject_Initialize(
|
|||||||
be done here. tp_dealloc still needs to call PyObject_GC_UnTrack(),
|
be done here. tp_dealloc still needs to call PyObject_GC_UnTrack(),
|
||||||
however.
|
however.
|
||||||
*/
|
*/
|
||||||
self->open = 1;
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user