8000 Fix incorrect size in test_sys for weakref/proxy · python/cpython@0d259d1 · GitHub
[go: up one dir, main page]

Skip to content

Commit 0d259d1

Browse files
committed
Fix incorrect size in test_sys for weakref/proxy
1 parent e6e2d28 commit 0d259d1

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

Lib/test/test_sys.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
import sysconfig
1313
import test.support
1414
from test import support
15-
from test.support import os_helper
15+
from test.support import os_helper, Py_GIL_DISABLED
1616
from test.support.script_helper import assert_python_ok, assert_python_failure
1717
from test.support import threading_helper
1818
from test.support import import_helper
@@ -1707,11 +1707,15 @@ class newstyleclass(object): pass
17071707
# TODO: add check that forces layout of unicodefields
17081708
# weakref
17091709
import weakref
1710-
check(weakref.ref(int), size('2Pn3P'))
1710+
if Py_GIL_DISABLED:
1711+
expected_size = size('2Pn4P')
1712+
else:
1713+
expected_size = size('2Pn3P')
1714+
check(weakref.ref(int), expected_size)
17111715
# weakproxy
17121716
# XXX
17131717
# weakcallableproxy
1714-
check(weakref.proxy(int), size('2Pn3P'))
1718+
check(weakref.proxy(int), expected_size)
17151719

17161720
def check_slots(self, obj, base, extra):
17171721
expected = sys.getsizeof(base) + struct.calcsize(extra)

0 commit comments

Comments
 (0)
0