Skip to content

Commit

Permalink
Stop gracefully on keyboard interrupt
Browse files Browse the repository at this point in the history
This patch prevents the application from printing a stack trace if it is
stopped via keyboard interrupt (`ctrl` + `c`).
  • Loading branch information
lkiesow committed Feb 8, 2024
1 parent cb4e54b commit bc99f32
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,8 +201,11 @@ def main():
x.start()

# Don't need that I think. Should implement restarting of a thread if function fails for some reason
for thread in threads:
thread.join()
try:
for thread in threads:
thread.join()
except KeyboardInterrupt:
pass


if __name__ == "__main__":
Expand Down

0 comments on commit bc99f32

Please sign in to comment.