From 1e1a38e7801f410f244e4bbb44ec795ae152e04e Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Sun, 6 Jan 2019 01:14:26 -0500 Subject: 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 --- lib/sqlalchemy/dialects/mysql/pymysql.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'lib/sqlalchemy/dialects/mysql/pymysql.py') diff --git a/lib/sqlalchemy/dialects/mysql/pymysql.py b/lib/sqlalchemy/dialects/mysql/pymysql.py index 5f176cef2..94dbfff06 100644 --- a/lib/sqlalchemy/dialects/mysql/pymysql.py +++ b/lib/sqlalchemy/dialects/mysql/pymysql.py @@ -34,7 +34,7 @@ from ...util import langhelpers, py3k class MySQLDialect_pymysql(MySQLDialect_mysqldb): - driver = 'pymysql' + driver = "pymysql" description_encoding = None @@ -51,7 +51,7 @@ class MySQLDialect_pymysql(MySQLDialect_mysqldb): @langhelpers.memoized_property def supports_server_side_cursors(self): try: - cursors = __import__('pymysql.cursors').cursors + cursors = __import__("pymysql.cursors").cursors self._sscursor = cursors.SSCursor return True except (ImportError, AttributeError): @@ -59,10 +59,12 @@ class MySQLDialect_pymysql(MySQLDialect_mysqldb): @classmethod def dbapi(cls): - return __import__('pymysql') + return __import__("pymysql") def is_disconnect(self, e, connection, cursor): - if super(MySQLDialect_pymysql, self).is_disconnect(e, connection, cursor): + if super(MySQLDialect_pymysql, self).is_disconnect( + e, connection, cursor + ): return True elif isinstance(e, self.dbapi.Error): return "Already closed" in str(e) @@ -70,9 +72,11 @@ class MySQLDialect_pymysql(MySQLDialect_mysqldb): return False if py3k: + def _extract_error_code(self, exception): if isinstance(exception.args[0], Exception): exception = exception.args[0] return exception.args[0] + dialect = MySQLDialect_pymysql -- cgit v1.2.1