diff --git a/synapse/app/homeserver.py b/synapse/app/homeserver.py
index 4e74f4d14c89df50ab4d9262b9e232ff93892f6e..17926be88c5ead82de6524983297f7a0388c6330 100755
--- a/synapse/app/homeserver.py
+++ b/synapse/app/homeserver.py
@@ -252,11 +252,11 @@ def setup():
         reactor.run()
 
 def run():
-    with LoggingContext("run") as context:
+    with LoggingContext("run"):
         reactor.run()
 
 def main():
-    with LoggingContext("main") as context:
+    with LoggingContext("main"):
         setup()
 
 if __name__ == '__main__':