summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authormike bayer <mike_mp@zzzcomputing.com>2020-05-13 17:15:59 +0000
committerGerrit Code Review <gerrit@bbpush.zzzcomputing.com>2020-05-13 17:15:59 +0000
commitdabc226af6d1396dca702a933f64cd7caa3aa126 (patch)
treec0359961ec02dcf62ee96064d227093ed705c518 /lib
parentce6619756e9f142394aa01e3ea70c9db781537e4 (diff)
parent587f6c77153235e3defcc6b0b6598634e1ee2828 (diff)
downloadsqlalchemy-dabc226af6d1396dca702a933f64cd7caa3aa126.tar.gz
Merge "Load external firebird or sybase dialect if available"
Diffstat (limited to 'lib')
-rw-r--r--lib/sqlalchemy/dialects/__init__.py12
1 files changed, 9 insertions, 3 deletions
diff --git a/lib/sqlalchemy/dialects/__init__.py b/lib/sqlalchemy/dialects/__init__.py
index 85929a9d6..86f567eb5 100644
--- a/lib/sqlalchemy/dialects/__init__.py
+++ b/lib/sqlalchemy/dialects/__init__.py
@@ -35,15 +35,21 @@ def _auto_fn(name):
if dialect == "firebird":
try:
module = __import__("sqlalchemy_firebird")
- dialect = "dialect"
- except:
+ except ImportError:
module = __import__("sqlalchemy.dialects.firebird").dialects
+ module = getattr(module, dialect)
+ elif dialect == "sybase":
+ try:
+ module = __import__("sqlalchemy_sybase")
+ except ImportError:
+ module = __import__("sqlalchemy.dialects.sybase").dialects
+ module = getattr(module, dialect)
else:
module = __import__("sqlalchemy.dialects.%s" % (dialect,)).dialects
+ module = getattr(module, dialect)
except ImportError:
return None
- module = getattr(module, dialect)
if hasattr(module, driver):
module = getattr(module, driver)
return lambda: module.dialect