summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--changelog.d/11816.misc1
-rw-r--r--synapse/app/_base.py14
2 files changed, 9 insertions, 6 deletions
diff --git a/changelog.d/11816.misc b/changelog.d/11816.misc
new file mode 100644
index 0000000000..b1f048f7f5
--- /dev/null
+++ b/changelog.d/11816.misc
@@ -0,0 +1 @@
+Drop support for Python 3.6, which is EOL.
\ No newline at end of file
diff --git a/synapse/app/_base.py b/synapse/app/_base.py
index 9efdd071cc..bbab8a052a 100644
--- a/synapse/app/_base.py
+++ b/synapse/app/_base.py
@@ -468,12 +468,14 @@ async def start(hs: "HomeServer") -> None:
     # everything currently allocated are things that will be used for the
     # rest of time. Doing so means less work each GC (hopefully).
     #
-    gc.collect()
-    gc.freeze()
-
-    # Speed up shutdowns by freezing all allocated objects. This moves everything
-    # into the permanent generation and excludes them from the final GC.
-    atexit.register(gc.freeze)
+    # PyPy does not (yet?) implement gc.freeze()
+    if hasattr(gc, "freeze"):
+        gc.collect()
+        gc.freeze()
+
+        # Speed up shutdowns by freezing all allocated objects. This moves everything
+        # into the permanent generation and excludes them from the final GC.
+        atexit.register(gc.freeze)
 
 
 def setup_sentry(hs: "HomeServer") -> None: