Skip to content

Commit 567105f

Browse files
Address feedback
1 parent 77a0373 commit 567105f

File tree

2 files changed

+1
-7
lines changed

2 files changed

+1
-7
lines changed

Lib/test/test_capi/test_tuple.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,10 @@ class TupleSubclass(tuple):
1515

1616
class CAPITest(unittest.TestCase):
1717
def _not_tracked(self, t):
18-
# There is no need for gc.collect()
19-
# since we don't track these tuples at all.
2018
self.assertFalse(gc.is_tracked(t), t)
2119

2220
def _tracked(self, t):
2321
self.assertTrue(gc.is_tracked(t), t)
24-
gc.collect()
25-
gc.collect()
26-
self.assertTrue(gc.is_tracked(t), t)
2722

2823
def test_check(self):
2924
# Test PyTuple_Check()
@@ -121,7 +116,6 @@ def test_tuple_pack(self):
121116
self.assertRaises(MemoryError, pack, PY_SSIZE_T_MAX)
122117

123118
# CRASHES pack(1, NULL)
124-
# CRASHES pack(1, None)
125119
# CRASHES pack(2, [1])
126120

127121
def test_tuple_size(self):

Objects/tupleobject.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ _PyTuple_MaybeUntrack(PyObject *op)
156156
_PyObject_GC_UNTRACK(op);
157157
}
158158

159-
/* This function helps to avoids performance issue in the GC,
159+
/* gh-139951: This function helps to avoid performance issue in the GC,
160160
* we don't track immutable tuples. */
161161
static bool
162162
tuple_need_tracking(PyTupleObject *self)

0 commit comments

Comments
 (0)