Skip to content

Commit d1fe4a2

Browse files
authored
Fix error while closing the python script
Runtimeerror exception on script close fix
1 parent 4852e0a commit d1fe4a2

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

AnimatedGif.py

+3
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
Released under the terms of the MIT license (https://opensource.org/licenses/MIT) as described in LICENSE.md
55
66
"""
7+
import sys
78
import time
89
try:
910
import Tkinter as tk # for Python2
@@ -69,3 +70,5 @@ def _animate_thread(self):
6970
self._num += 1
7071
except tk.TclError: # When we try a frame that doesn't exist, we know we have to start over from zero
7172
self._num = 0
73+
except RuntimeError:
74+
sys.exit()

0 commit comments

Comments
 (0)