Skip to content

Commit 73a2e67

Browse files
committed
Require OTP-21+ and remove erlang:get_stacktrace/0 usage
1 parent e9a5971 commit 73a2e67

File tree

3 files changed

+6
-15
lines changed

3 files changed

+6
-15
lines changed

Makefile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,9 @@ dep_ct_helper = git https://github.com/ninenines/ct_helper master
1515
dep_ci.erlang.mk = git https://github.com/ninenines/ci.erlang.mk master
1616
DEP_EARLY_PLUGINS = ci.erlang.mk
1717

18-
AUTO_CI_OTP ?= OTP-20+
18+
AUTO_CI_OTP ?= OTP-21+
1919
AUTO_CI_HIPE ?= OTP-LATEST
2020
# AUTO_CI_ERLLVM ?= OTP-LATEST
21-
# Not sure why but the groff tests fail before OTP-21.
2221
AUTO_CI_WINDOWS ?= OTP-21+
2322

2423
include erlang.mk

src/asciideck_to_html.erl

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,6 @@
1414

1515
-module(asciideck_to_html).
1616

17-
-ifdef(OTP_RELEASE).
18-
-compile({nowarn_deprecated_function, [{erlang, get_stacktrace, 0}]}).
19-
-endif.
20-
2117
-export([translate/2]).
2218

2319
translate(AST, Opts) ->
@@ -81,8 +77,8 @@ ast_node(Node={Type, _, _, _}) ->
8177
comment_line -> comment_line(Node);
8278
_ -> ast_error({unknown_type, Node})
8379
end
84-
catch C:E ->
85-
ast_error({crash, C, E, erlang:get_stacktrace(), Node})
80+
catch C:E:S ->
81+
ast_error({crash, C, E, S, Node})
8682
end.
8783

8884
ast_error(Error) ->
@@ -124,7 +120,7 @@ paragraph({paragraph, _, Text, _}) ->
124120
listing_block({listing_block, Attrs, Listing0, _}) ->
125121
Listing = case Attrs of
126122
#{1 := <<"source">>, 2 := _} ->
127-
try asciideck_source_highlight:filter(Listing0, Attrs) catch C:E -> io:format("~p ~p ~p~n", [C, E, erlang:get_stacktrace()]), exit(bad) end;
123+
try asciideck_source_highlight:filter(Listing0, Attrs) catch C:E:S -> io:format("~p ~p ~p~n", [C, E, S]), exit(bad) end;
128124
_ ->
129125
["<pre>", html_encode(Listing0), "</pre>"]
130126
end,

src/asciideck_to_manpage.erl

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,6 @@
1616
%% description of the format expected for man pages.
1717
-module(asciideck_to_manpage).
1818

19-
-ifdef(OTP_RELEASE).
20-
-compile({nowarn_deprecated_function, [{erlang, get_stacktrace, 0}]}).
21-
-endif.
22-
2319
-export([translate/2]).
2420

2521
translate(AST, Opts) ->
@@ -86,9 +82,9 @@ ast_node(Node={Type, _, _, _}) ->
8682
io:format("Ignored AST node ~p~n", [Node]),
8783
[]
8884
end
89-
catch C:E ->
85+
catch C:E:S ->
9086
io:format("Ignored AST node ~p~nReason: ~p:~p~nStacktrace: ~p~n",
91-
[Node, C, E, erlang:get_stacktrace()]),
87+
[Node, C, E, S]),
9288
[]
9389
end.
9490

0 commit comments

Comments
 (0)