def blowstack(fxn, arg, compare_to):
# Make sure that calling isinstance with a deeply nested tuple for its
# argument will raise RuntimeError eventually.
tuple_arg = (compare_to,)
if test_support.check_impl_detail(cpython=True):
RECURSION_LIMIT = sys.getrecursionlimit()
else:
# on non-CPython implementations, the maximum
# actual recursion limit might be higher, but
# probably not higher than 99999
#
RECURSION_LIMIT = 99999
for cnt in xrange(RECURSION_LIMIT+5):
tuple_arg = (tuple_arg,)
fxn(arg, tuple_arg)
评论列表
文章目录