]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
use logging to output exc_info here
authorMike Bayer <mike_mp@zzzcomputing.com>
Sat, 4 May 2013 18:24:20 +0000 (14:24 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Sat, 4 May 2013 18:24:20 +0000 (14:24 -0400)
lib/sqlalchemy/engine/base.py

index d4ced4cca9b49bfea4236549a7e331b5bcd8ccc7..c2ba0922b2b85b8d98ef4aa722c3119e374bde20 100644 (file)
@@ -956,17 +956,11 @@ class Connection(Connectable):
         """
         try:
             cursor.close()
-        except Exception as e:
-            try:
-                ex_text = str(e)
-            except TypeError:
-                ex_text = repr(e)
-            if not self.closed:
-                self.connection._logger.warn(
-                            "Error closing cursor: %s", ex_text)
-
-            if isinstance(e, (SystemExit, KeyboardInterrupt)):
-                raise
+        except (SystemExit, KeyboardInterrupt):
+            raise
+        except Exception:
+            self.connection._logger.error(
+                                    "Error closing cursor", exc_info=True)
 
     _reentrant_error = False
     _is_disconnect = False