mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2024-10-01 11:49:51 -04:00
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>
This commit is contained in:
parent
f2c1560eca
commit
13c7ab8181
1
changelog.d/9270.misc
Normal file
1
changelog.d/9270.misc
Normal file
@ -0,0 +1 @@
|
|||||||
|
Restore PyPy compatibility by not calling CPython-specific GC methods when under PyPy.
|
@ -16,6 +16,7 @@
|
|||||||
import gc
|
import gc
|
||||||
import logging
|
import logging
|
||||||
import os
|
import os
|
||||||
|
import platform
|
||||||
import signal
|
import signal
|
||||||
import socket
|
import socket
|
||||||
import sys
|
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).
|
# rest of time. Doing so means less work each GC (hopefully).
|
||||||
#
|
#
|
||||||
# This only works on Python 3.7
|
# 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.collect()
|
||||||
gc.freeze()
|
gc.freeze()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user