osbuild. add comment why AST is used and not importlib
Add comment why the `ModuleInfo.load()` code uses open()/ast.parse() instead of just using `importlib`. The reason is that while `importlib` is more convenient and much shorter it would require that all python modules of the osbuild modules are actually installed on the system just to inspect the schema/documentation of the stage.
This commit is contained in:
parent
016407284a
commit
29e05c689e
1 changed files with 2 additions and 0 deletions
|
|
@ -429,6 +429,8 @@ class ModuleInfo:
|
|||
except FileNotFoundError:
|
||||
return None
|
||||
|
||||
# using AST here and not importlib because we can read/parse
|
||||
# even if some python imports that the module may need are missing
|
||||
tree = ast.parse(data, name)
|
||||
|
||||
docstring = ast.get_docstring(tree)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue