@@ -46,6 +46,11 @@ function scrub_exc_stack(stack)
46
46
return Any[ (x[1 ], scrub_backtrace (x[2 ])) for x in stack ]
47
47
end
48
48
49
+ # Compat for catch_stack(), which was deprecated in 1.7
50
+ @static if VERSION < v " 1.7"
51
+ current_exceptions () = Base. catch_stack ()
52
+ end
53
+
49
54
mutable struct Format
50
55
stats:: Bool
51
56
desc_align:: Int
@@ -531,7 +536,7 @@ function testset_beginend(mod::Module, isfinal::Bool, pat::Pattern, id::Int64, d
531
536
# something in the test block threw an error. Count that as an
532
537
# error in this test set
533
538
record (ts, Error (:nontest_error , Expr (:tuple ), err,
534
- Base . catch_stack (), $ (QuoteNode (source))))
539
+ current_exceptions (), $ (QuoteNode (source))))
535
540
finally
536
541
copy! (RNG, oldrng)
537
542
setresult! ($ marks, ts. subject, ! anyfailed (ts))
@@ -594,7 +599,7 @@ function testset_forloop(mod::Module, isfinal::Bool, pat::Pattern, id::Int64,
594
599
err isa InterruptException && rethrow ()
595
600
# Something in the test block threw an error. Count that as an
596
601
# error in this test set
597
- record (ts, Error (:nontest_error , Expr (:tuple ), err, Base . catch_stack (), $ (QuoteNode (source))))
602
+ record (ts, Error (:nontest_error , Expr (:tuple ), err, current_exceptions (), $ (QuoteNode (source))))
598
603
setresult! ($ marks, ts. subject, false )
599
604
end
600
605
end
0 commit comments