Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 07a2b7d

Browse filesBrowse files
authored
Merge pull request #1 from jkopczyn/jkopczyn-patch-cursor
Only delete cursor if it exists.
2 parents cddc375 + 55c4e51 commit 07a2b7d
Copy full SHA for 07a2b7d

File tree

Expand file treeCollapse file tree

1 file changed

+1
-1
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+1
-1
lines changed

‎MySQLdb/connections.py

Copy file name to clipboardExpand all lines: MySQLdb/connections.py
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,9 @@ def defaulterrorhandler(connection, cursor, errorclass, errorvalue):
4242
error = errorclass, errorvalue
4343
if cursor:
4444
cursor.messages.append(error)
45+
del cursor
4546
else:
4647
connection.messages.append(error)
47-
del cursor
4848
del connection
4949
if isinstance(errorvalue, BaseException):
5050
raise errorvalue

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.