Skip to content

Commit

Permalink
set i_main_module properly when a submodule is validated standalone
Browse files Browse the repository at this point in the history
  • Loading branch information
mbj4668 committed Nov 15, 2023
1 parent 987f59c commit 495dda0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pyang/statements.py
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,8 @@ def v_init_module(ctx, stmt):
prefix = belongs_to.search_one('prefix')
stmt.i_modulename = belongs_to.arg
mod = ctx.get_module(stmt.i_modulename)
if mod is None:
if mod is None or not mod.i_is_validated:
# this happens if a submodule is validated standalone
mod = stmt
else:
stmt.i_modulename = ""
Expand Down

0 comments on commit 495dda0

Please sign in to comment.