mirror of
https://github.com/element-hq/synapse
synced 2024-08-19 09:10:52 +00:00
Fix pep8 error on psycopg2cffi hack
This commit is contained in:
parent
89de934981
commit
d1e56cfcd1
1 changed files with 5 additions and 6 deletions
|
@ -32,12 +32,11 @@ def create_engine(database_config):
|
|||
engine_class = SUPPORTED_MODULE.get(name, None)
|
||||
|
||||
if engine_class:
|
||||
needs_pypy_hack = (name == "psycopg2" and
|
||||
platform.python_implementation() == "PyPy")
|
||||
if needs_pypy_hack:
|
||||
module = importlib.import_module("psycopg2cffi")
|
||||
else:
|
||||
module = importlib.import_module(name)
|
||||
# pypy requires psycopg2cffi rather than psycopg2
|
||||
if (name == "psycopg2" and
|
||||
platform.python_implementation() == "PyPy"):
|
||||
name = "psycopg2cffi"
|
||||
module = importlib.import_module(name)
|
||||
return engine_class(module, database_config)
|
||||
|
||||
raise RuntimeError(
|
||||
|
|
Loading…
Reference in a new issue