summary refs log tree commit diff
path: root/synapse
diff options
context:
space:
mode:
authorAdrian Tschira <nota@notafile.com>2018-04-28 13:04:40 +0200
committerAdrian Tschira <nota@notafile.com>2018-04-28 13:36:30 +0200
commitcdb4647a80dfccf4f8865a04c28bfaffa378ef10 (patch)
tree143c1afae04dd0789d321e070d51c11c4e52610e /synapse
parentMerge pull request #3127 from matrix-org/rav/deferred_timeout (diff)
downloadsynapse-cdb4647a80dfccf4f8865a04c28bfaffa378ef10.tar.xz
Don't yield in list comprehensions
I've tried to grep for more of this with no success.

Signed-off-by: Adrian Tschira <nota@notafile.com>
Diffstat (limited to '')
-rw-r--r--synapse/handlers/appservice.py14
1 files changed, 9 insertions, 5 deletions
diff --git a/synapse/handlers/appservice.py b/synapse/handlers/appservice.py
index 0245197c02..b7776693de 100644
--- a/synapse/handlers/appservice.py
+++ b/synapse/handlers/appservice.py
@@ -259,11 +259,15 @@ class ApplicationServicesHandler(object):
             event based on the service regex.
         """
         services = self.store.get_app_services()
-        interested_list = [
-            s for s in services if (
-                yield s.is_interested(event, self.store)
-            )
-        ]
+
+        # we can't use a list comprehension here. Since python 3, list
+        # comprehensions use a generator internally. This means you can't yield
+        # inside of a list comprehension anymore.
+        interested_list = []
+        for s in services:
+            if (yield s.is_interested(event, self.store)):
+                interested_list.append(s)
+
         defer.returnValue(interested_list)
 
     def _get_services_for_user(self, user_id):