]> granicus.if.org Git - python/commitdiff
Patch #997284: Allow pydoc to work with XP Themes (.manifest file)
authorMartin v. Löwis <martin@v.loewis.de>
Sun, 22 Aug 2004 16:13:26 +0000 (16:13 +0000)
committerMartin v. Löwis <martin@v.loewis.de>
Sun, 22 Aug 2004 16:13:26 +0000 (16:13 +0000)
Will backport to 2.3.

Lib/pydoc.py

index c6a84db11063a4f1f152be4d681041c2726a7aee..433bd281d7302662b056f33a18ec359531e4f3a0 100755 (executable)
@@ -2124,8 +2124,16 @@ def gui():
 
     import Tkinter
     try:
-        gui = GUI(Tkinter.Tk())
-        Tkinter.mainloop()
+        root = Tkinter.Tk()
+        # Tk will crash if pythonw.exe has an XP .manifest
+        # file and the root has is not destroyed explicitly.
+        # If the problem is ever fixed in Tk, the explicit
+        # destroy can go.
+        try:
+            gui = GUI(root)
+            root.mainloop()
+        finally:
+            root.destroy()
     except KeyboardInterrupt:
         pass