summary refs log tree commit diff
path: root/synapse/storage/directory.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2015-04-28 14:24:08 +0100
committerErik Johnston <erik@matrix.org>2015-04-28 14:24:08 +0100
commit9fbcf191889b655d5c93d01a738e5137aa94a354 (patch)
tree8a403e4b27825447695fe09b54bb2440df734ed5 /synapse/storage/directory.py
parentMerge pull request #126 from matrix-org/csauth (diff)
parentRemove unused imports (diff)
downloadsynapse-9fbcf191889b655d5c93d01a738e5137aa94a354.tar.xz
Merge pull request #123 from matrix-org/postgres
Postgres
Diffstat (limited to 'synapse/storage/directory.py')
-rw-r--r--synapse/storage/directory.py8
1 files changed, 3 insertions, 5 deletions
diff --git a/synapse/storage/directory.py b/synapse/storage/directory.py
index 0199539fea..2b2bdf8615 100644
--- a/synapse/storage/directory.py
+++ b/synapse/storage/directory.py
@@ -21,8 +21,6 @@ from twisted.internet import defer
 
 from collections import namedtuple
 
-import sqlite3
-
 
 RoomAliasMapping = namedtuple(
     "RoomAliasMapping",
@@ -91,7 +89,7 @@ class DirectoryStore(SQLBaseStore):
                 },
                 desc="create_room_alias_association",
             )
-        except sqlite3.IntegrityError:
+        except self.database_engine.module.IntegrityError:
             raise SynapseError(
                 409, "Room alias %s already exists" % room_alias.to_string()
             )
@@ -120,12 +118,12 @@ class DirectoryStore(SQLBaseStore):
         defer.returnValue(room_id)
 
     def _delete_room_alias_txn(self, txn, room_alias):
-        cursor = txn.execute(
+        txn.execute(
             "SELECT room_id FROM room_aliases WHERE room_alias = ?",
             (room_alias.to_string(),)
         )
 
-        res = cursor.fetchone()
+        res = txn.fetchone()
         if res:
             room_id = res[0]
         else: