File tree 1 file changed +3
-6
lines changed
1 file changed +3
-6
lines changed Original file line number Diff line number Diff line change @@ -60,11 +60,10 @@ class BaseCursor(object):
60
60
InternalError , ProgrammingError , NotSupportedError
61
61
62
62
_defer_warnings = False
63
+ connection = None
63
64
64
65
def __init__ (self , connection ):
65
- from weakref import ref
66
-
67
- self .connection = ref (connection )
66
+ self .connection = connection
68
67
self .description = None
69
68
self .description_flags = None
70
69
self .rowcount = - 1
@@ -81,7 +80,7 @@ def __init__(self, connection):
81
80
def close (self ):
82
81
"""Close the cursor. No further queries will be possible."""
83
82
try :
84
- if self .connection is None or self . connection () is None :
83
+ if self .connection is None :
85
84
return
86
85
while self .nextset ():
87
86
pass
@@ -192,8 +191,6 @@ def setoutputsizes(self, *args):
192
191
193
192
def _get_db (self ):
194
193
con = self .connection
195
- if con is not None :
196
- con = con ()
197
194
if con is None :
198
195
raise ProgrammingError ("cursor closed" )
199
196
return con
You can’t perform that action at this time.
0 commit comments