diff options
author | Ivan Shapovalov <intelfx@intelfx.name> | 2021-01-30 20:22:05 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-30 17:22:05 +0000 |
commit | 13c7ab81817df8f6028668ca318c6de1ad498313 (patch) | |
tree | 66279546dfcc814618e956cecabba73f219c15c6 /synapse/app/_base.py | |
parent | Ratelimit invites by room and target user (#9258) (diff) | |
download | synapse-13c7ab81817df8f6028668ca318c6de1ad498313.tar.xz |
Fixes for PyPy compatibility (#9270)
* synapse.app.base: only call gc.freeze() on CPython gc.freeze() is an implementation detail of CPython garbage collector, and notably does not exist on PyPy. Rather than playing whack-a-mole and skipping the call when under PyPy, simply restrict it to CPython because the whole gc module is implementation-defined. Signed-off-by: Ivan Shapovalov <intelfx@intelfx.name>
Diffstat (limited to 'synapse/app/_base.py')
-rw-r--r-- | synapse/app/_base.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/synapse/app/_base.py b/synapse/app/_base.py index 395e202b89..9840a9d55b 100644 --- a/synapse/app/_base.py +++ b/synapse/app/_base.py @@ -16,6 +16,7 @@ import gc import logging import os +import platform import signal import socket import sys @@ -339,7 +340,7 @@ async def start(hs: "synapse.server.HomeServer", listeners: Iterable[ListenerCon # rest of time. Doing so means less work each GC (hopefully). # # This only works on Python 3.7 - if sys.version_info >= (3, 7): + if platform.python_implementation() == "CPython" and sys.version_info >= (3, 7): gc.collect() gc.freeze() |