The source project of this merge request has been removed.
Improved the output in case of exec syntax errors
- do_exec() now outputs file name, line number and offending code line
Given the following trivial RepoSurgeon extension script exec.py
:
# Following line attempts to use print as statement
print "Test"
we would get the following error output prior to this patch:
reposurgeon% exec <./exec.py
reposurgeon: invalid syntax in extension function
after this patch it becomes a little more understandable:
reposurgeon% exec <./exec.py
reposurgeon: extension function - invalid syntax (exec.py, line 2)
print "Test"
although it is not immediately clear what the cause might be - it's due
to reposurgeon
using from __future__ import print_function
- it is
now clear which line is the culprit.
In a more complex script this can be very beneficial.