MRF, Docs.Generator: Ensure code is loaded before checking it

This commit is contained in:
Lain Soykaf 2023-11-30 09:40:17 +04:00
commit 15a8acbd6c
2 changed files with 5 additions and 0 deletions

View file

@ -17,6 +17,8 @@ defmodule Pleroma.Docs.Generator do
# This shouldn't be needed as all modules are expected to have module_info/1,
# but in test enviroments some transient modules `:elixir_compiler_XX`
# are loaded for some reason (where XX is a random integer).
Code.ensure_loaded(module)
if function_exported?(module, :module_info, 1) do
module.module_info(:attributes)
|> Keyword.get_values(:behaviour)