File tree Expand file tree Collapse file tree 1 file changed +15
-2
lines changed
Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -56,7 +56,14 @@ def test_regression_issue_1220_get_face_chip():
5656 # we expect two references:
5757 # 1.) the local variable
5858 # 2.) the temporary passed to getrefcount
59- assert sys .getrefcount (face_chip ) == 2
59+ #
60+ # Python 3.14 has changed the way references are counted (borrowed references)
61+ # https://docs.python.org/3.14/whatsnew/3.14.html#limited-c-api-changes
62+ # https://github.com/davisking/dlib/issues/3096
63+ if sys .version_info < (3 , 14 ):
64+ assert sys .getrefcount (face_chip ) == 2
65+ else :
66+ assert sys .getrefcount (face_chip ) == 1
6067
6168
6269@pytest .mark .skipif (not utils .is_numpy_installed (), reason = "requires numpy" )
@@ -67,6 +74,12 @@ def test_regression_issue_1220_get_face_chips():
6774 """
6875 face_chips = get_test_face_chips ()
6976 count = sys .getrefcount (face_chips )
70- assert count == 2
77+ # Python 3.14 has changed the way references are counted (borrowed references)
78+ # https://docs.python.org/3.14/whatsnew/3.14.html#limited-c-api-changes
79+ # https://github.com/davisking/dlib/issues/3096
80+ if sys .version_info < (3 , 14 ):
81+ assert count == 2
82+ else :
83+ assert count == 1
7184 count = sys .getrefcount (face_chips [0 ])
7285 assert count == 2
You can’t perform that action at this time.
0 commit comments