Skip to content
Snippets Groups Projects
Commit d1e56cfc authored by Richard van der Hoff's avatar Richard van der Hoff Committed by Vincent Breitmoser
Browse files

Fix pep8 error on psycopg2cffi hack

parent 89de9349
No related branches found
No related tags found
No related merge requests found
......@@ -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(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment