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

Commit98b78d2

Browse files
committed
Rungc.collect() twice intest_rename on Python 3.12
Recently, the conditional `gc.collect()` step for Python >= 3.12 in`TestSubmodule.test_rename` is often insufficient. This has mainlybeen seen in #2248. For example:https://github.com/gitpython-developers/GitPython/actions/runs/22864869684/job/66331124651?pr=2106#step:12:620In principle, there can be situations with finalizers where a cycleis only collectable due to finalization that happened due to aprevious collection. Therefore, there is occasionally a benefit tocollecting twice. This does that, in the hope that it will help.
1 parentc0a3d5f commit98b78d2

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

‎test/test_submodule.py‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1011,6 +1011,7 @@ def test_rename(self, rwdir):
10111011
# garbage collector detailed in https://github.com/python/cpython/issues/97922.)
10121012
ifsys.platform=="win32"andsys.version_info>= (3,12):
10131013
gc.collect()
1014+
gc.collect()# Some finalizer scenarios need two collections, at least in theory.
10141015

10151016
new_path="renamed/myname"
10161017
assertsm.move(new_path).name==new_path

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2026 Movatter.jp