mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-02 10:56:06 -04:00
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.
This commit is contained in:
parent
9fbe70a7dc
commit
89de934981
2 changed files with 8 additions and 2 deletions
|
@ -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
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue