Skip to content

Commit 81cc54b

Browse files
committed
Forgot to update test_call
1 parent bdcc6e3 commit 81cc54b

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

Lib/test/test_call.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1048,9 +1048,14 @@ def get_sp():
10481048

10491049
this_sp = _testinternalcapi.get_stack_pointer()
10501050
lower_sp = _testcapi.pyobject_vectorcall(get_sp, (), ())
1051-
self.assertLess(lower_sp, this_sp)
1051+
if _testcapi._Py_STACK_GROWS_DOWN:
1052+
self.assertLess(lower_sp, this_sp)
1053+
safe_margin = this_sp - lower_sp
1054+
else:
1055+
self.assertLess(this_sp, lower_sp)
1056+
safe_margin = lower_sp - this_sp
10521057
# Add an (arbitrary) extra 20% for safety
1053-
safe_margin = (this_sp - lower_sp) * 6 / 5
1058+
safe_margin *= 6 / 5
10541059
self.assertLess(safe_margin, _testinternalcapi.get_stack_margin())
10551060

10561061
@skip_on_s390x

0 commit comments

Comments
 (0)