From 102eca58299957fa806d1e6d09cc39c596e02c04 Mon Sep 17 00:00:00 2001 From: bbean Date: Thu, 4 Apr 2024 11:10:09 -0600 Subject: [PATCH] remove extraneous function from copy-paste error --- opencsp/common/lib/tool/tk_tools.py | 30 ----------------------------- 1 file changed, 30 deletions(-) diff --git a/opencsp/common/lib/tool/tk_tools.py b/opencsp/common/lib/tool/tk_tools.py index 2bee986ba..29fb5aae6 100644 --- a/opencsp/common/lib/tool/tk_tools.py +++ b/opencsp/common/lib/tool/tk_tools.py @@ -91,33 +91,3 @@ def window(*vargs, TopLevel=False, **kwargs): time.sleep(1) return window_class(*vargs, **kwargs) - - -def _window(*vargs, **kwargs): - """Initializes and returns a new tkinter.Tk() instance. - - If creating the window fails, tries again (up to two more times). - - Sometimes initializing a tk window fails. But if you try to - initialize the window again, it seems to always succeed. - When it fails, it is often with an error about not being able to find a - file. Something like:: - - _tkinter.TclError: Can't find a usable init.tcl in the following directories - """ - try: - # try to create a window - return tk.Tk(*vargs, **kwargs) - except Exception: - try: - lt.warn("Failed to create a tkinter.Tk() window. Trying again (2nd attempt).") - # first attempt failed, try again - return tk.Tk(*vargs, **kwargs) - except Exception: - # second attempt failed, give the system a second to stabalize and - # try a third time - lt.warn("Failed to create a tkinter.Tk() window. Trying again (3rd attempt).") - import time - - time.sleep(1) - return tk.Tk(*vargs, **kwargs)