Closed mohidmeer closed 1 year ago
@ShishirPatil I saw this after the PR in issues someone already mentioned it #12 here
Thanks for this PR @mohidmeer I think this might need a refactor for Linux and Mac systems? I still seem to get the traceback..
@ShishirPatil I used exit(); if NoneType is passed i should exit
@ShishirPatil if selected_command==None: print('Process Exited') exit();
@ShishirPatil
@ShishirPatil if selected_command==None: print('Process Exited') exit();
Thanks for this @mohidmeer
But you see the subsequent code requires that selected_command
and exit_condition
are populated to complete the request. You are write that the exit() will side-step it, but a) there is no log for what heppens then, so we can't tell if the command was successfully executed or if there is a syntax bug to fix, and b) using exit()
in the middle of the file is considered bad practice unless otherwise strictly necessary! Hence, I suggested the below. Thoughts?
if selected_command is not None:
exit_condition = execute_command(selected_command)
else:
selected_command = "Cancelled"
exit_condition = "Cancelled"
I understand now @ShishirPatil thanks for explanation you want to complete the life cycle of script Instead of abruptly exiting the code
When User exits via keyboard Interupt
Whenever user exits the process via keyboard interupt like CTRL+C (NoneType is passed which) it shows error in terminal as Follow
Before
After Fix