summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/inspection.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2019-01-06 01:14:26 -0500
committermike bayer <mike_mp@zzzcomputing.com>2019-01-06 17:34:50 +0000
commit1e1a38e7801f410f244e4bbb44ec795ae152e04e (patch)
tree28e725c5c8188bd0cfd133d1e268dbca9b524978 /lib/sqlalchemy/inspection.py
parent404e69426b05a82d905cbb3ad33adafccddb00dd (diff)
downloadsqlalchemy-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/inspection.py')
-rw-r--r--lib/sqlalchemy/inspection.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/sqlalchemy/inspection.py b/lib/sqlalchemy/inspection.py
index 3a03e2507..7c2ff97c5 100644
--- a/lib/sqlalchemy/inspection.py
+++ b/lib/sqlalchemy/inspection.py
@@ -32,6 +32,7 @@ in a forwards-compatible way.
"""
from . import util, exc
+
_registrars = util.defaultdict(list)
@@ -66,13 +67,11 @@ def inspect(subject, raiseerr=True):
else:
reg = ret = None
- if raiseerr and (
- reg is None or ret is None
- ):
+ if raiseerr and (reg is None or ret is None):
raise exc.NoInspectionAvailable(
"No inspection system is "
- "available for object of type %s" %
- type_)
+ "available for object of type %s" % type_
+ )
return ret
@@ -81,10 +80,11 @@ def _inspects(*types):
for type_ in types:
if type_ in _registrars:
raise AssertionError(
- "Type %s is already "
- "registered" % type_)
+ "Type %s is already " "registered" % type_
+ )
_registrars[type_] = fn_or_cls
return fn_or_cls
+
return decorate