Skip to content

Commit

Permalink
modifying KeyboardInterrupt error catch location
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Haigh <mhaigh@netapp.com>
  • Loading branch information
MichaelHaigh committed May 9, 2024
1 parent 4ef9071 commit e661271
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions toolkit.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
from astraSDK.common import getConfig


def main(argv=sys.argv, config=None):
def tkMain(argv=sys.argv, config=None):
# The various functions to populate the lists used for choices() in the options are
# expensive. argparse provides no way to know what subcommand was selected prior to
# parsing the options. By then it's too late to decide which functions to run to
Expand Down Expand Up @@ -265,8 +265,12 @@ def main(argv=sys.argv, config=None):
tkSrc.update.main(args, ard, config=config)


if __name__ == "__main__":
def main(argv=sys.argv, config=None):
try:
main()
tkMain(argv=argv, config=config)
except KeyboardInterrupt:
pass


if __name__ == "__main__":
main()

0 comments on commit e661271

Please sign in to comment.