- also correct for dbapi is a Mock without __version__...

Change-Id: I9e6b61a3292a2a6c8bb281c2375f2326282bcb76
This commit is contained in:
Mike Bayer
2018-10-20 17:51:10 -04:00
parent ead6fee1a7
commit 1963fdceae
+2 -1
View File
@@ -88,7 +88,8 @@ class MySQLDialect_mysqldb(MySQLDialect):
super(MySQLDialect_mysqldb, self).__init__(**kwargs)
self.server_side_cursors = server_side_cursors
self._mysql_dbapi_version = self._parse_dbapi_version(
self.dbapi.__version__) if self.dbapi is not None else (0, 0, 0)
self.dbapi.__version__) if self.dbapi is not None \
and hasattr(self.dbapi, '__version__') else (0, 0, 0)
def _parse_dbapi_version(self, version):
m = re.match(r'(\d+)\.(\d+)(?:\.(\d+))?', version)