Skip to content

Commit 6d3faea

Browse files
committed
gc
1 parent eddfbc4 commit 6d3faea

23 files changed

Lines changed: 1076 additions & 244 deletions

File tree

‎.cspell.dict/cpython.txt‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,7 @@ uncollectable
184184
Unhandle
185185
unparse
186186
unparser
187+
untracking
187188
VARKEYWORDS
188189
varkwarg
189190
venvlauncher
@@ -197,5 +198,6 @@ weakrefobject
197198
webpki
198199
withitem
199200
withs
201+
worklist
200202
xstat
201203
XXPRIME

‎.cspell.json‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@
6666
"emscripten",
6767
"excs",
6868
"finalizer",
69+
"finalizers",
6970
"GetSet",
7071
"groupref",
7172
"internable",
@@ -120,12 +121,14 @@
120121
"sysmodule",
121122
"tracebacks",
122123
"typealiases",
124+
"uncollectable",
123125
"unhashable",
124126
"uninit",
125127
"unraisable",
126128
"unresizable",
127129
"varint",
128130
"wasi",
131+
"weaked",
129132
"zelf",
130133
// unix
131134
"posixshmem",

‎CLAUDE.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
AGENTS.md

‎Cargo.lock‎

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎Cargo.toml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ winresource = "0.1"
3333
rustpython-compiler = { workspace = true }
3434
rustpython-pylib = { workspace = true, optional = true }
3535
rustpython-stdlib = { workspace = true, optional = true, features = ["compiler"] }
36-
rustpython-vm = { workspace = true, features = ["compiler"] }
36+
rustpython-vm = { workspace = true, features = ["compiler", "gc"] }
3737
ruff_python_parser = { workspace = true }
3838

3939
cfg-if = { workspace = true }

‎Lib/test/support/__init__.py‎

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -919,13 +919,6 @@ def disable_gc():
919919

920920
@contextlib.contextmanager
921921
def gc_threshold(*args):
922-
# TODO: RUSTPYTHON; GC is not supported yet
923-
try:
924-
yield
925-
finally:
926-
pass
927-
return
928-
929922
import gc
930923
old_threshold = gc.get_threshold()
931924
gc.set_threshold(*args)

‎Lib/test/test_asyncio/test_ssl.py‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1649,7 +1649,6 @@ async def test(ctx):
16491649
# SSLProtocol should be DECREF to 0
16501650
self.assertIsNone(ctx())
16511651

1652-
@unittest.expectedFailure # TODO: RUSTPYTHON; - gc.collect() doesn't release SSLContext properly
16531652
def test_shutdown_timeout_handler_leak(self):
16541653
loop = self.loop
16551654

‎Lib/test/test_io.py‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4856,13 +4856,15 @@ def run():
48564856
else:
48574857
self.assertFalse(err.strip('.!'))
48584858

4859-
@unittest.expectedFailure # TODO: RUSTPYTHON; without GC+GIL, finalize_modules clears __main__ globals while daemon threads are still running
4859+
# TODO: RUSTPYTHON; daemon thread exception during shutdown due to finalizing order change
4860+
@unittest.expectedFailure
48604861
@threading_helper.requires_working_threading()
48614862
@support.requires_resource('walltime')
48624863
def test_daemon_threads_shutdown_stdout_deadlock(self):
48634864
self.check_daemon_threads_shutdown_deadlock('stdout')
48644865

4865-
@unittest.expectedFailure # TODO: RUSTPYTHON; without GC+GIL, finalize_modules clears __main__ globals while daemon threads are still running
4866+
# TODO: RUSTPYTHON; daemon thread exception during shutdown due to finalizing order change
4867+
@unittest.expectedFailure
48664868
@threading_helper.requires_working_threading()
48674869
@support.requires_resource('walltime')
48684870
def test_daemon_threads_shutdown_stderr_deadlock(self):

‎Lib/test/test_weakref.py‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1330,11 +1330,9 @@ def check_len_cycles(self, dict_type, cons):
13301330
self.assertIn(n1, (0, 1))
13311331
self.assertEqual(n2, 0)
13321332

1333-
@unittest.expectedFailure # TODO: RUSTPYTHON
13341333
def test_weak_keyed_len_cycles(self):
13351334
self.check_len_cycles(weakref.WeakKeyDictionary, lambda k: (k, 1))
13361335

1337-
@unittest.expectedFailure # TODO: RUSTPYTHON
13381336
def test_weak_valued_len_cycles(self):
13391337
self.check_len_cycles(weakref.WeakValueDictionary, lambda k: (1, k))
13401338

‎Lib/test/test_weakset.py‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -403,8 +403,6 @@ def testcontext():
403403
s.clear()
404404
self.assertEqual(len(s), 0)
405405

406-
# TODO: RUSTPYTHON
407-
@unittest.expectedFailure
408406
def test_len_cycles(self):
409407
N = 20
410408
items = [RefCycle() for i in range(N)]

0 commit comments

Comments
 (0)