From 914c73d5aa2d87d55bcc10b3bf5cfd4d4f6a8f93 Mon Sep 17 00:00:00 2001 From: emkael Date: Fri, 19 Jul 2019 12:05:18 +0200 Subject: "Handling" of some GUI errors that occur during file load/unload and component attach/detach --- jfr_playoff/gui/frames/match.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'jfr_playoff/gui/frames/match.py') diff --git a/jfr_playoff/gui/frames/match.py b/jfr_playoff/gui/frames/match.py index 4c8736c..685d399 100644 --- a/jfr_playoff/gui/frames/match.py +++ b/jfr_playoff/gui/frames/match.py @@ -600,10 +600,14 @@ class MatchSettingsFrame(RepeatableFrame): @property def label(self): - phase = self._getPhase() - return 'Mecz #%d (%s)' % ( - self.getMatchID(), - phase.master.tab(phase)['text'] if phase is not None else '') + try: + phase = self._getPhase() + return 'Mecz #%d (%s)' % ( + self.getMatchID(), + phase.master.tab(phase)['text'] if phase is not None else '') + except tk.TclError: + # we're probably just being created, ignore + return '' def setValue(self, value): self.matchID.set(value['id'] if 'id' in value else 0) -- cgit v1.2.3