diff --git a/textx/model.py b/textx/model.py index 98c4fee8..09fdec7f 100644 --- a/textx/model.py +++ b/textx/model.py @@ -746,6 +746,10 @@ def call_obj_processors(metamodel, model_obj, for m in models: assert not m._tx_reference_resolver.parser._inst_stack + # cleanup + for m in models: + _end_model_construction(m) + # At this point we should restore original user attr methods as # attribute collection is over and we should switch back to # "normal" behavior @@ -783,10 +787,6 @@ def call_obj_processors(metamodel, model_obj, parser.dprint(traceback.print_exc()) raise e - # cleanup - for m in models: - _end_model_construction(m) - # final check that everything went ok for m in models: assert 0 == len(get_children_of_type(