Skip to content

Commit

Permalink
Fixed runtests.py crash on PyPy.
Browse files Browse the repository at this point in the history
The gc.set_threshold() call was made conditional to non-PyPy
implementations. The method is not available in PyPy3, and GC is much
less aggressive there, so the adjustment probably is not necessary.
  • Loading branch information
mgorny authored and felixxm committed Nov 21, 2023
1 parent 6af83d2 commit 09b4a4e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tests/runtests.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@
# references, which are a minority, so the garbage collection threshold can be
# larger than the default threshold of 700 allocations + deallocations without
# much increase in memory usage.
gc.set_threshold(100_000)
if not hasattr(sys, "pypy_version_info"):
gc.set_threshold(100_000)

RUNTESTS_DIR = os.path.abspath(os.path.dirname(__file__))

Expand Down

0 comments on commit 09b4a4e

Please sign in to comment.