Skip to content

Commit

Permalink
Remove call for get_Stackgtrace for erlagn 21
Browse files Browse the repository at this point in the history
  • Loading branch information
Licenser committed May 3, 2018
1 parent 346fdbe commit b0e89de
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 8 deletions.
4 changes: 4 additions & 0 deletions rebar.config
Expand Up @@ -14,3 +14,7 @@
{deps, [
{cuttlefish, "~>2.0.12"}
]}.
{plugins, [{rebar_erl_vsn, "~>0.1.7"}]}.
{provider_hooks, [{pre, [{compile, erl_vsn}]}]}.


3 changes: 2 additions & 1 deletion src/clique_config.erl
Expand Up @@ -428,7 +428,8 @@ set_config_test_setup() ->

?assertEqual(ok, file:write_file(?SET_TEST_SCHEMA_FILE, Schema)),
?assertEqual(ok, init()),
?assertEqual(ok, load_schema([Cwd])).
?assertEqual(ok, load_schema([Cwd])),
clique_nodes:teardown().

set_config_test_teardown(_) ->
_ = ets:delete(?config_table),
Expand Down
26 changes: 20 additions & 6 deletions src/clique_test_group_leader.erl
Expand Up @@ -104,19 +104,33 @@ io_request(From, ReplyAs, Req, State) ->
io_reply(From, ReplyAs, Reply) ->
From ! {io_reply, ReplyAs, Reply}.

-ifndef('21.0').
put_chars(M, F, A, State) ->
try apply(M, F, A) of
Chars ->
io_request({put_chars, Chars}, State)
catch C:T ->
{{error, {C,T, erlang:get_stacktrace()}}, State}
end.
-else.
put_chars(M, F, A, State) ->
try apply(M, F, A) of
Chars ->
io_request({put_chars, Chars}, State)
catch C:T:Stack ->
{{error, {C,T, Stack}}, State}
end.
-endif.

%% Handles io requests
%% Output:
io_request({put_chars, Chars},
#state{output=O}=State) when is_binary(Chars);
is_list(Chars) ->
{ok, State#state{output=[Chars|O]}};

io_request({put_chars, M, F, A}, State) ->
try apply(M, F, A) of
Chars ->
io_request({put_chars, Chars}, State)
catch C:T ->
{{error, {C,T, erlang:get_stacktrace()}}, State}
end;
put_chars(M, F, A, State);
io_request({put_chars, _Enc, Chars}, State) ->
io_request({put_chars, Chars}, State);
io_request({put_chars, _Enc, Mod, Func, Args}, State) ->
Expand Down
1 change: 0 additions & 1 deletion src/clique_usage.erl
Expand Up @@ -20,7 +20,6 @@
-module(clique_usage).

-ifdef(TEST).
-compile(export_all).
-include_lib("eunit/include/eunit.hrl").
-endif.

Expand Down

0 comments on commit b0e89de

Please sign in to comment.