Skip to content
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Reapply RustPython patches
  • Loading branch information
ShaharNaveh committed Jul 25, 2025
commit b51f6de0c84c52002dae46fbd3dffd0e63db761f
12 changes: 12 additions & 0 deletions Lib/test/support/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -501,6 +501,8 @@ def requires_lzma(reason='requires lzma'):
import lzma
except ImportError:
lzma = None
# XXX: RUSTPYTHON; xz is not supported yet
lzma = None
return unittest.skipUnless(lzma, reason)

def has_no_debug_ranges():
Expand Down Expand Up @@ -808,13 +810,18 @@ def gc_collect():
longer than expected. This function tries its best to force all garbage
objects to disappear.
"""
return # TODO: RUSTPYTHON

import gc
gc.collect()
gc.collect()
gc.collect()

@contextlib.contextmanager
def disable_gc():
yield # TODO: RUSTPYTHON
return # TODO: RUSTPYTHON

import gc
have_gc = gc.isenabled()
gc.disable()
Expand All @@ -826,6 +833,9 @@ def disable_gc():

@contextlib.contextmanager
def gc_threshold(*args):
yield # TODO: RUSTPYTHON
return # TODO: RUSTPYTHON

import gc
old_threshold = gc.get_threshold()
gc.set_threshold(*args)
Expand Down Expand Up @@ -1888,6 +1898,8 @@ def _check_tracemalloc():


def check_free_after_iterating(test, iter, cls, args=()):
return # TODO: RUSTPYTHON; GC is not supported yet

done = False
def wrapper():
class A(cls):
Expand Down