summary refs log tree commit diff
path: root/synapse/storage/client_ips.py
diff options
context:
space:
mode:
authorAdrian Tschira <nota@notafile.com>2018-04-28 13:19:12 +0200
committerAdrian Tschira <nota@notafile.com>2018-05-19 17:59:26 +0200
commit933bf2dd357842b0e7c3fc7a1111d89ab52f5329 (patch)
tree3a40de02b5227d0cb2ee4725b1c70b33868c45f9 /synapse/storage/client_ips.py
parentMerge pull request #3241 from matrix-org/fix_user_visits_insertion (diff)
downloadsynapse-933bf2dd357842b0e7c3fc7a1111d89ab52f5329.tar.xz
replace some iteritems with six
Signed-off-by: Adrian Tschira <nota@notafile.com>
Diffstat (limited to 'synapse/storage/client_ips.py')
-rw-r--r--synapse/storage/client_ips.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/synapse/storage/client_ips.py b/synapse/storage/client_ips.py
index ba46907737..ce338514e8 100644
--- a/synapse/storage/client_ips.py
+++ b/synapse/storage/client_ips.py
@@ -22,6 +22,8 @@ from . import background_updates
 
 from synapse.util.caches import CACHE_SIZE_FACTOR
 
+from six import iteritems
+
 
 logger = logging.getLogger(__name__)
 
@@ -99,7 +101,7 @@ class ClientIpStore(background_updates.BackgroundUpdateStore):
     def _update_client_ips_batch_txn(self, txn, to_update):
         self.database_engine.lock_table(txn, "user_ips")
 
-        for entry in to_update.iteritems():
+        for entry in iteritems(to_update):
             (user_id, access_token, ip), (user_agent, device_id, last_seen) = entry
 
             self._simple_upsert_txn(
@@ -231,5 +233,5 @@ class ClientIpStore(background_updates.BackgroundUpdateStore):
                 "user_agent": user_agent,
                 "last_seen": last_seen,
             }
-            for (access_token, ip), (user_agent, last_seen) in results.iteritems()
+            for (access_token, ip), (user_agent, last_seen) in iteritems(results)
         ))