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/pyodbc.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/pyodbc.py')
-rw-r--r-- | lib/sqlalchemy/dialects/mysql/pyodbc.py | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/lib/sqlalchemy/dialects/mysql/pyodbc.py b/lib/sqlalchemy/dialects/mysql/pyodbc.py index 718754651..91512857e 100644 --- a/lib/sqlalchemy/dialects/mysql/pyodbc.py +++ b/lib/sqlalchemy/dialects/mysql/pyodbc.py @@ -29,7 +29,6 @@ import re class MySQLExecutionContext_pyodbc(MySQLExecutionContext): - def get_lastrowid(self): cursor = self.create_cursor() cursor.execute("SELECT LAST_INSERT_ID()") @@ -46,7 +45,7 @@ class MySQLDialect_pyodbc(PyODBCConnector, MySQLDialect): def __init__(self, **kw): # deal with http://code.google.com/p/pyodbc/issues/detail?id=25 - kw.setdefault('convert_unicode', True) + kw.setdefault("convert_unicode", True) super(MySQLDialect_pyodbc, self).__init__(**kw) def _detect_charset(self, connection): @@ -60,13 +59,15 @@ class MySQLDialect_pyodbc(PyODBCConnector, MySQLDialect): # this can prefer the driver value. rs = connection.execute("SHOW VARIABLES LIKE 'character_set%%'") opts = {row[0]: row[1] for row in self._compat_fetchall(rs)} - for key in ('character_set_connection', 'character_set'): + for key in ("character_set_connection", "character_set"): if opts.get(key, None): return opts[key] - util.warn("Could not detect the connection character set. " - "Assuming latin1.") - return 'latin1' + util.warn( + "Could not detect the connection character set. " + "Assuming latin1." + ) + return "latin1" def _extract_error_code(self, exception): m = re.compile(r"\((\d+)\)").search(str(exception.args)) @@ -76,4 +77,5 @@ class MySQLDialect_pyodbc(PyODBCConnector, MySQLDialect): else: return None + dialect = MySQLDialect_pyodbc |