Skip to content

Commit 641a2eb

Browse files
committed
Merge pull request #42 from tiwilliam/cursor-closed-exception
Raise `ProgrammingError` properly when connection is closed
2 parents d768ef0 + bf470a4 commit 641a2eb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

MySQLdb/cursors.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ def _get_db(self):
163163
if con is not None:
164164
con = con()
165165
if con is None:
166-
self.errorhandler(self, ProgrammingError, "cursor closed")
166+
raise ProgrammingError("cursor closed")
167167
return con
168168

169169
def execute(self, query, args=None):

0 commit comments

Comments
 (0)