We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bdcc6e3 commit 81cc54bCopy full SHA for 81cc54b
Lib/test/test_call.py
@@ -1048,9 +1048,14 @@ def get_sp():
1048
1049
this_sp = _testinternalcapi.get_stack_pointer()
1050
lower_sp = _testcapi.pyobject_vectorcall(get_sp, (), ())
1051
- self.assertLess(lower_sp, this_sp)
+ 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
1057
# Add an (arbitrary) extra 20% for safety
- safe_margin = (this_sp - lower_sp) * 6 / 5
1058
+ safe_margin *= 6 / 5
1059
self.assertLess(safe_margin, _testinternalcapi.get_stack_margin())
1060
1061
@skip_on_s390x
0 commit comments