Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ecf6d53 commit ea80e8fCopy full SHA for ea80e8f
MySQLdb/_mysql.c
@@ -446,6 +446,7 @@ _mysql_ConnectionObject_Initialize(
446
447
Py_BEGIN_ALLOW_THREADS ;
448
conn = mysql_init(&(self->connection));
449
+ self->open = 1;
450
if (connect_timeout) {
451
unsigned int timeout = connect_timeout;
452
mysql_options(&(self->connection), MYSQL_OPT_CONNECT_TIMEOUT,
@@ -496,6 +497,7 @@ _mysql_ConnectionObject_Initialize(
496
497
498
if (!conn) {
499
_mysql_Exception(self);
500
+ self->open = 0;
501
return -1;
502
}
503
@@ -515,7 +517,6 @@ _mysql_ConnectionObject_Initialize(
515
517
be done here. tp_dealloc still needs to call PyObject_GC_UnTrack(),
516
518
however.
519
*/
- self->open = 1;
520
return 0;
521
522
0 commit comments