From bf470a4f71e0e1c9de1095b793a4c209c0d30c2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?William=20Tisa=CC=88ter?= Date: Fri, 1 May 2015 20:56:16 +0200 Subject: [PATCH] Raise `ProgrammingError` properly when connection is closed --- MySQLdb/cursors.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MySQLdb/cursors.py b/MySQLdb/cursors.py index f51ceb0..be5538a 100644 --- a/MySQLdb/cursors.py +++ b/MySQLdb/cursors.py @@ -163,7 +163,7 @@ class BaseCursor(object): if con is not None: con = con() if con is None: - self.errorhandler(self, ProgrammingError, "cursor closed") + raise ProgrammingError("cursor closed") return con def execute(self, query, args=None):