diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2019-01-06 01:14:26 -0500 |
---|---|---|
committer | mike bayer <mike_mp@zzzcomputing.com> | 2019-01-06 17:34:50 +0000 |
commit | 1e1a38e7801f410f244e4bbb44ec795ae152e04e (patch) | |
tree | 28e725c5c8188bd0cfd133d1e268dbca9b524978 /lib/sqlalchemy/dialects/mysql/cymysql.py | |
parent | 404e69426b05a82d905cbb3ad33adafccddb00dd (diff) | |
download | sqlalchemy-1e1a38e7801f410f244e4bbb44ec795ae152e04e.tar.gz |
Run black -l 79 against all source files
This is a straight reformat run using black as is, with no edits
applied at all.
The black run will format code consistently, however in
some cases that are prevalent in SQLAlchemy code it produces
too-long lines. The too-long lines will be resolved in the
following commit that will resolve all remaining flake8 issues
including shadowed builtins, long lines, import order, unused
imports, duplicate imports, and docstring issues.
Change-Id: I7eda77fed3d8e73df84b3651fd6cfcfe858d4dc9
Diffstat (limited to 'lib/sqlalchemy/dialects/mysql/cymysql.py')
-rw-r--r-- | lib/sqlalchemy/dialects/mysql/cymysql.py | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/lib/sqlalchemy/dialects/mysql/cymysql.py b/lib/sqlalchemy/dialects/mysql/cymysql.py index d14290594..8a60608db 100644 --- a/lib/sqlalchemy/dialects/mysql/cymysql.py +++ b/lib/sqlalchemy/dialects/mysql/cymysql.py @@ -18,7 +18,7 @@ import re from .mysqldb import MySQLDialect_mysqldb -from .base import (BIT, MySQLDialect) +from .base import BIT, MySQLDialect from ... import util @@ -34,27 +34,23 @@ class _cymysqlBIT(BIT): v = v << 8 | i return v return value + return process class MySQLDialect_cymysql(MySQLDialect_mysqldb): - driver = 'cymysql' + driver = "cymysql" description_encoding = None supports_sane_rowcount = True supports_sane_multi_rowcount = False supports_unicode_statements = True - colspecs = util.update_copy( - MySQLDialect.colspecs, - { - BIT: _cymysqlBIT, - } - ) + colspecs = util.update_copy(MySQLDialect.colspecs, {BIT: _cymysqlBIT}) @classmethod def dbapi(cls): - return __import__('cymysql') + return __import__("cymysql") def _detect_charset(self, connection): return connection.connection.charset @@ -64,8 +60,13 @@ class MySQLDialect_cymysql(MySQLDialect_mysqldb): def is_disconnect(self, e, connection, cursor): if isinstance(e, self.dbapi.OperationalError): - return self._extract_error_code(e) in \ - (2006, 2013, 2014, 2045, 2055) + return self._extract_error_code(e) in ( + 2006, + 2013, + 2014, + 2045, + 2055, + ) elif isinstance(e, self.dbapi.InterfaceError): # if underlying connection is closed, # this is the error you get @@ -73,4 +74,5 @@ class MySQLDialect_cymysql(MySQLDialect_mysqldb): else: return False + dialect = MySQLDialect_cymysql |