File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
Filter options
Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
Original file line number Diff line number Diff line change @@ -1373,9 +1373,15 @@ _mysql_ResultObject_fetch_row(
1373
1373
convert_row = row_converters [how ];
1374
1374
if (maxrows ) {
1375
1375
if (!(r = PyTuple_New (maxrows ))) goto error ;
1376
- rowsadded = _mysql__fetch_row (self , & r , skiprows , maxrows ,
1377
- convert_row );
1376
+
1377
+ // see: https://docs.python.org/3/library/gc.html#gc.get_referrers
1378
+ // This function can get a reference to the tuple r, and if that
1379
+ // code is preempted while holding a ref to r, the _PyTuple_Resize
1380
+ // will raise a SystemError because the ref count is 2.
1381
+ PyObject_GC_UnTrack (r );
1382
+ rowsadded = _mysql__fetch_row (self , & r , skiprows , maxrows , convert_row );
1378
1383
if (rowsadded == -1 ) goto error ;
1384
+ PyObject_GC_Track (r );
1379
1385
} else {
1380
1386
if (self -> use ) {
1381
1387
maxrows = 1000 ;
You can’t perform that action at this time.
0 commit comments