Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit1b1db2f

Browse files
authored
gh-118846: Fix PGO tests in free-threaded build (#118862)
Avoid immortalizing objects in tests that verify garbage collection ofclasses or modules.This fixes test_ordered_dict and test_struct.
1 parent71cc065 commit1b1db2f

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

‎Lib/test/test_ordered_dict.py‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
importweakref
1111
fromcollections.abcimportMutableMapping
1212
fromtestimportmapping_tests,support
13-
fromtest.supportimportimport_helper
13+
fromtest.supportimportimport_helper,suppress_immortalization
1414

1515

1616
py_coll=import_helper.import_fresh_module('collections',
@@ -667,6 +667,7 @@ def test_dict_update(self):
667667
dict.update(od, [('spam',1)])
668668
self.assertNotIn('NULL',repr(od))
669669

670+
@suppress_immortalization()
670671
deftest_reference_loop(self):
671672
# Issue 25935
672673
OrderedDict=self.OrderedDict

‎Lib/test/test_struct.py‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
importweakref
1010

1111
fromtestimportsupport
12-
fromtest.supportimportimport_helper
12+
fromtest.supportimportimport_helper,suppress_immortalization
1313
fromtest.support.script_helperimportassert_python_ok
1414

1515
ISBIGENDIAN=sys.byteorder=="big"
@@ -674,6 +674,7 @@ def __del__(self):
674674
self.assertIn(b"Exception ignored in:",stderr)
675675
self.assertIn(b"C.__del__",stderr)
676676

677+
@suppress_immortalization()
677678
deftest__struct_reference_cycle_cleaned_up(self):
678679
# Regression test for python/cpython#94207.
679680

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp