TCL set_sys command handler exits with error
Issue #248
resolved
It does not matter if the command succeeds, the code directs the feedback to indicate that the request failed.
Comments (5)
-
reporter -
repo owner Wow, I can't believe this has been like this for so long. I thought it was a recent bug.
The solution is simpler. Just need:
else: self.raise_tcl_error("No such system parameter \"{}\".".format(param))
at the end.
The original try/except is alright. It is okay if it fails. It means,
value
does not get replaced. -
reporter - changed title to TCL set_sys command handler exits with error
-
repo owner - changed status to resolved
Fix issue
#248where set_sys command returned failure feedback even on command success.→ <<cset cd28ff9fdd67>>
-
repo owner Merged in codeZonkey/flatcam (pull request #78)
Fix issue
#248where set_sys command returned failure feedback even on command success.→ <<cset a7cb9e7801dd>>
- Log in to comment
@jpcgt I'm no python expert but the original code seems to have used an early return statement to indicate success:
https://bitbucket.org/jpcgt/flatcam/commits/261054f1cf11c65a9d3013721c1f5f1f4c1514a7#LFlatCAMApp.pyT3666
The current version of the code simply runs through the end of the method where the error is printed:
https://bitbucket.org/jpcgt/flatcam/commits/261054f1cf11c65a9d3013721c1f5f1f4c1514a7#LtclCommands/TclCommandSetSys.pyT72
Should the fixed code look more like this:
Let me know, I can make the fix and commit the update.