Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Fixes for PyPy compatibility #9270

Merged
merged 3 commits into from
Jan 30, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/9270.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Restore PyPy compatibility by not calling CPython-specific GC methods when under PyPy.
3 changes: 2 additions & 1 deletion synapse/app/_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import gc
import logging
import os
import platform
import signal
import socket
import sys
Expand Down Expand Up @@ -339,7 +340,7 @@ def run_sighup(*args, **kwargs):
# 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()

Expand Down