Skip to content

Commit

Permalink
core: ensure cursor is not hidden in case of failures
Browse files Browse the repository at this point in the history
  • Loading branch information
pavdmyt committed Aug 14, 2021
1 parent 42ca0f1 commit aaa58db
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion yaspin/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,12 @@ def start(self):
self._stop_spin = threading.Event()
self._hide_spin = threading.Event()
self._spin_thread = threading.Thread(target=self._spin)
self._spin_thread.start()
try:
self._spin_thread.start()
finally:
# Ensure cursor is not hidden if any failure occurs that prevents
# getting it back
self._show_cursor()

def stop(self):
self._stop_time = time.time()
Expand Down

0 comments on commit aaa58db

Please sign in to comment.