mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-01-13 09:19:24 -05:00
Fix pep8 error on psycopg2cffi hack
This commit is contained in:
parent
89de934981
commit
d1e56cfcd1
@ -32,12 +32,11 @@ def create_engine(database_config):
|
|||||||
engine_class = SUPPORTED_MODULE.get(name, None)
|
engine_class = SUPPORTED_MODULE.get(name, None)
|
||||||
|
|
||||||
if engine_class:
|
if engine_class:
|
||||||
needs_pypy_hack = (name == "psycopg2" and
|
# pypy requires psycopg2cffi rather than psycopg2
|
||||||
platform.python_implementation() == "PyPy")
|
if (name == "psycopg2" and
|
||||||
if needs_pypy_hack:
|
platform.python_implementation() == "PyPy"):
|
||||||
module = importlib.import_module("psycopg2cffi")
|
name = "psycopg2cffi"
|
||||||
else:
|
module = importlib.import_module(name)
|
||||||
module = importlib.import_module(name)
|
|
||||||
return engine_class(module, database_config)
|
return engine_class(module, database_config)
|
||||||
|
|
||||||
raise RuntimeError(
|
raise RuntimeError(
|
||||||
|
Loading…
Reference in New Issue
Block a user