diff options
author | Richard van der Hoff <1389908+richvdh@users.noreply.github.com> | 2018-04-11 11:20:01 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-11 11:20:01 +0100 |
commit | 233699c42e1cc6c0b3f3fa28bf62f80204f701ee (patch) | |
tree | ece93e263e91f64f1bb24725b69734b4bf32274b /synapse/storage | |
parent | Merge pull request #3086 from matrix-org/r30_stats (diff) | |
parent | Don't disable GC when running on PyPy (diff) | |
download | synapse-233699c42e1cc6c0b3f3fa28bf62f80204f701ee.tar.xz |
Merge pull request #2760 from Valodim/pypy
Synapse on PyPy
Diffstat (limited to 'synapse/storage')
-rw-r--r-- | synapse/storage/_base.py | 2 | ||||
-rw-r--r-- | synapse/storage/engines/__init__.py | 5 |
2 files changed, 6 insertions, 1 deletions
diff --git a/synapse/storage/_base.py b/synapse/storage/_base.py index 2fbebd4907..2262776ab2 100644 --- a/synapse/storage/_base.py +++ b/synapse/storage/_base.py @@ -376,7 +376,7 @@ class SQLBaseStore(object): Returns: A list of dicts where the key is the column header. """ - col_headers = list(intern(column[0]) for column in cursor.description) + col_headers = list(intern(str(column[0])) for column in cursor.description) results = list( dict(zip(col_headers, row)) for row in cursor ) diff --git a/synapse/storage/engines/__init__.py b/synapse/storage/engines/__init__.py index 338b495611..8c868ece75 100644 --- a/synapse/storage/engines/__init__.py +++ b/synapse/storage/engines/__init__.py @@ -18,6 +18,7 @@ from .postgres import PostgresEngine from .sqlite3 import Sqlite3Engine import importlib +import platform SUPPORTED_MODULE = { @@ -31,6 +32,10 @@ def create_engine(database_config): engine_class = SUPPORTED_MODULE.get(name, None) if engine_class: + # 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) |