Skip to content

Commit b3ccffc

Browse files
committed
Move gc.collect closer to count
1 parent d13a059 commit b3ccffc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Lib/test/test_sys.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1093,7 +1093,6 @@ def test_getallocatedblocks(self):
10931093
gc.collect()
10941094
b = sys.getallocatedblocks()
10951095
self.assertLessEqual(b, a)
1096-
gc.collect()
10971096
try:
10981097
# While we could imagine a Python session where the number of
10991098
# multiple buffer objects would exceed the sharing of references,
@@ -1109,6 +1108,7 @@ def test_getallocatedblocks(self):
11091108
except AttributeError:
11101109
# gettotalrefcount() not available
11111110
pass
1111+
gc.collect()
11121112
c = sys.getallocatedblocks()
11131113
self.assertIn(c, range(b - 50, b + 50))
11141114

0 commit comments

Comments
 (0)