mbj4668 / pyang

An extensible YANG validator and converter in python
ISC License
530 stars 343 forks source link

Fixes #802 - init i_is_primary_module attribute #803

Closed wlupton closed 2 years ago

wlupton commented 2 years ago

Thanks to @jboyd77 for pointing out this problem, and for the fix.

See issue #802 for context. The proposed fix adds an _init_i_attrs() method (called from ModSubmodStatement.__init__() and ModSubmodStatement.internal_reset()) in order to prevent this from happening again the next time such an internal attribute (i.e., one that requires initialization) is added. It already happened in PR #580!

I didn't add a test case (the change seems rather obviously to fix the problem) but could do so if requested.

fredgan commented 2 years ago

LGTM