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 c9f0215 commit 4434b24Copy full SHA for 4434b24
Lib/test/test_call.py
@@ -1048,9 +1048,12 @@ 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
+ else:
1054
+ self.assertGreater(lower_sp, this_sp)
1055
# Add an (arbitrary) extra 25% for safety
- safe_margin = (this_sp - lower_sp) * 5 / 4
1056
+ safe_margin = abs(this_sp - lower_sp) * 5 / 4
1057
self.assertLess(safe_margin, _testinternalcapi.get_stack_margin())
1058
1059
@skip_on_s390x
0 commit comments