New GitHub issue #94979 from kumaraditya303:<br>

<hr>

<pre>
Commit tested: a25a803c4c

```console
@kumaraditya303 ➜ /workspaces/cpython (main) $ ./python -m test -R 3:3 test_sys_settrace
0:00:00 load avg: 31.03 Run tests sequentially
0:00:00 load avg: 31.03 [1/1] test_sys_settrace
beginning 6 repetitions
123456
......
test_sys_settrace leaked [6604, 6602, 6604] references, sum=19810
test_sys_settrace leaked [1835, 1860, 1856] memory blocks, sum=5551
test_sys_settrace failed (reference leak)

== Tests result: FAILURE ==

1 test failed:
    test_sys_settrace

Total duration: 1.2 sec
Tests result: FAILURE
```

</pre>

<hr>

<a href="https://github.com/python/cpython/issues/94979">View on GitHub</a>
<p>Labels: type-bug, 3.12</p>
<p>Assignee: </p>