crash of session when using an import
Input > use math.pi; a = pi
Traceback (most recent call last):
File "/home/ubuntu/vre-language/src/virtmat/language/utilities/errors.py", line 67, in wrapper
return func(*args, **kwargs)
File "/home/ubuntu/vre-language/src/virtmat/language/interpreter/session_manager.py", line 174, in get_model_value
return getattr(self.session.get_model(*args, **kwargs), 'value', '')
File "/home/ubuntu/vre-language/src/virtmat/language/interpreter/session_manager.py", line 146, in get_model
self.model = tx_get_model(model_src, deferred_mode=True,
File "/home/ubuntu/python3-venv/lib/python3.8/site-packages/textx/metamodel.py", line 647, in model_from_str
p(model, self)
File "/home/ubuntu/vre-language/src/virtmat/language/interpreter/workflow_executor.py", line 314, in workflow_model_processor
append_nodes(model, new_nodes)
File "/home/ubuntu/vre-language/src/virtmat/language/interpreter/workflow_executor.py", line 291, in append_nodes
assert all(p is not None for p in parents)
AssertionError
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "../scripts/run_session.py", line 45, in <module>
main()
File "../scripts/run_session.py", line 41, in main
mgr.main_loop()
File "/home/ubuntu/vre-language/src/virtmat/language/interpreter/session_manager.py", line 211, in main_loop
output = self.get_model_value(model_str=input_str)
File "/home/ubuntu/vre-language/src/virtmat/language/utilities/errors.py", line 71, in wrapper
raise RuntimeError('non-handled exception') from err
RuntimeError: non-handled exception
It works with use math.pi; print(pi)
but the import is not available in the next input:
Input > use math.pi; print(pi)
Output > 3.141592653589793
Input > a = pi
Unknown object: None:2:5
Unknown object "pi" of class "GeneralVariable"