From 030ef1f0ef37ccaebde06e58f22cd0de5a74c5d0 Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Tue, 3 Apr 2007 16:06:06 +0000 Subject: for #516, moved the "disconnect check" step out of pool and back into base.py. dialects have is_disconnect() method now. simpler design which also puts control of the ultimate "execute" call back into the hands of the dialects. --- lib/sqlalchemy/databases/mysql.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'lib/sqlalchemy/databases/mysql.py') diff --git a/lib/sqlalchemy/databases/mysql.py b/lib/sqlalchemy/databases/mysql.py index 7ea98e92f..03297cd68 100644 --- a/lib/sqlalchemy/databases/mysql.py +++ b/lib/sqlalchemy/databases/mysql.py @@ -342,11 +342,8 @@ class MySQLDialect(ansisql.ANSIDialect): except: pass - def get_disconnect_checker(self): - def disconnect_checker(e): - return isinstance(e, self.dbapi.OperationalError) and e.args[0] in (2006, 2014) - return disconnect_checker - + def is_disconnect(self, e): + return isinstance(e, self.dbapi.OperationalError) and e.args[0] in (2006, 2014) def get_default_schema_name(self): if not hasattr(self, '_default_schema_name'): -- cgit v1.2.1