summary refs log tree commit diff
path: root/synapse/storage/_base.py
diff options
context:
space:
mode:
authorVincent Breitmoser <look@my.amazin.horse>2018-01-06 18:13:56 +0100
committerVincent Breitmoser <look@my.amazin.horse>2018-04-10 11:29:52 +0200
commit89de9349815b79f55bfff53b7c8c6d43f8c30336 (patch)
tree0397dbdbc4f9c3f6258c8cd7dd2faddf8510ff75 /synapse/storage/_base.py
parentUse sortedcontainers instead of blist (diff)
downloadsynapse-89de9349815b79f55bfff53b7c8c6d43f8c30336.tar.xz
Use psycopg2cffi module instead of psycopg2 if running on pypy
The psycopg2 package isn't available for PyPy.  This commit adds a check
if the runtime is PyPy, and if it is uses psycopg2cffi module in favor
of psycopg2. This is almost a drop-in replacement, except for one place
where an additional cast to string is required.
Diffstat (limited to 'synapse/storage/_base.py')
-rw-r--r--synapse/storage/_base.py2
1 files changed, 1 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
         )