Calling validate_telemac.py with a non-existent Python script raises an exception
Summary
Calling validate_telemac.py
with a non-existent Python script raises an exception.
Environment
- Operating System: all
- TELEMAC version: main
Steps to reproduce
validate_telemac.py foobar.py
What is the current bug behaviour?
Two exceptions are raised.
What is the expected correct behaviour?
The script should exit without throwing, just telling the user that the VnV script supplied does not exist.
Relevant logs and/or screenshots
Validation < 1/1 > of <root>/foobar.py
Traceback (most recent call last):
File "/home/user/telemac/scripts/python3/validate_telemac.py", line 508, in run_python
raise exc
File "/home/user/telemac/scripts/python3/validate_telemac.py", line 444, in run_python
raise TelemacException(\
utils.exceptions.TelemacException:
Not able to find your Python file:
/home/user/telemac/foobar.py
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/user/telemac/scripts/python3/validate_telemac.py", line 829, in <module>
sys.exit(main())
^^^^^^
File "/home/user/telemac/scripts/python3/validate_telemac.py", line 809, in main
run_validation_python_mpi(cfg, options, report, xcpts)
File "/home/user/telemac/scripts/python3/validate_telemac.py", line 176, in run_validation_python_mpi
run_python(py_file, options, report, xcpts)
File "/home/user/telemac/scripts/python3/validate_telemac.py", line 511, in run_python
if my_vnv_study is not None:
^^^^^^^^^^^^
UnboundLocalError: cannot access local variable 'my_vnv_study' where it is not associated with a value