Skip to content

Commit

Permalink
Remove warning when trying to call :proc_lib.get_labe/1
Browse files Browse the repository at this point in the history
  • Loading branch information
hugobarauna committed Jun 12, 2024
1 parent 6d0ec6f commit 07f90b1
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions lib/kino/process.ex
Original file line number Diff line number Diff line change
Expand Up @@ -430,12 +430,11 @@ defmodule Kino.Process do
{func_result, sequence_diagram}
end

defp get_label(pid) do
# :proc_lib.get_label/1 was added in OTP 27
case function_exported?(:proc_lib, :get_label, 1) do
true -> :proc_lib.get_label(pid)
false -> :undefined
end
# :proc_lib.get_label/1 was added in OTP 27
if Code.ensure_loaded?(:proc_lib) and function_exported?(:proc_lib, :get_label, 1) do
defp get_label(pid), do: :proc_lib.get_label(pid)
else
defp get_label(_pid), do: :undefined
end

defp generate_participant_entry(pid, idx, process_label) do
Expand Down

0 comments on commit 07f90b1

Please sign in to comment.