Skip to content

Commit

Permalink
Prevent tk from trying to write into a closed console_frame:Writer
Browse files Browse the repository at this point in the history
  • Loading branch information
Baharis committed Feb 27, 2025
1 parent 3a811bf commit 089f905
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/instamatic/gui/gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,9 @@ def __init__(self, root, cam, modules: list = []):
self.root.bind('<Escape>', self.close)

def close(self):
# Prevent tk from trying to write into a closed `console_frame:Writer`
sys.stdout = sys.__stdout__
sys.stderr = sys.__stderr__
try:
self.stream_frame.close()
except AttributeError:
Expand Down

0 comments on commit 089f905

Please sign in to comment.