File tree Expand file tree Collapse file tree 3 files changed +34
-16
lines changed Expand file tree Collapse file tree 3 files changed +34
-16
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,11 @@ Released on 2022-10-03
44=========================
55
66
7+ gh-97527: Fix a bug in the previous bugfix that caused IDLE to not
8+ start when run with 3.10.8, 3.12.0a1, and at least Microsoft Python
9+ 3.10.2288.0 installed without the Lib/test package. 3.11.0 was never
10+ affected.
11+
712gh-65802: Document handling of extensions in Save As dialogs.
813
914gh-95191: Include prompts when saving Shell (interactive input/output).
Original file line number Diff line number Diff line change 44from os .path import expanduser
55import plistlib
66from sys import platform # Used in _init_tk_type, changed by test.
7- from test .support import requires , ResourceDenied
87
98import tkinter
109
1615
1716def _init_tk_type ():
1817 """ Initialize _tk_type for isXyzTk functions.
18+
19+ This function is only called once, when _tk_type is still None.
1920 """
2021 global _tk_type
2122 if platform == 'darwin' :
22- try :
23- requires ('gui' )
24- except ResourceDenied : # Possible when testing.
25- _tk_type = "cocoa" # Newest and most common.
26- else :
27- root = tkinter .Tk ()
28- ws = root .tk .call ('tk' , 'windowingsystem' )
29- if 'x11' in ws :
30- _tk_type = "xquartz"
31- elif 'aqua' not in ws :
32- _tk_type = "other"
33- elif 'AppKit' in root .tk .call ('winfo' , 'server' , '.' ):
23+
24+ # When running IDLE, GUI is present, test/* may not be.
25+ # When running tests, test/* is present, GUI may not be.
26+ # If not, guess most common. Does not matter for testing.
27+ from idlelib .__init__ import testing
28+ if testing :
29+ from test .support import requires , ResourceDenied
30+ try :
31+ requires ('gui' )
32+ except ResourceDenied :
3433 _tk_type = "cocoa"
35- else :
36- _tk_type = "carbon"
37- root .destroy ()
34+ return
35+
36+ root = tkinter .Tk ()
37+ ws = root .tk .call ('tk' , 'windowingsystem' )
38+ if 'x11' in ws :
39+ _tk_type = "xquartz"
40+ elif 'aqua' not in ws :
41+ _tk_type = "other"
42+ elif 'AppKit' in root .tk .call ('winfo' , 'server' , '.' ):
43+ _tk_type = "cocoa"
44+ else :
45+ _tk_type = "carbon"
46+ root .destroy ()
3847 else :
3948 _tk_type = "other"
49+ return
4050
4151def isAquaTk ():
4252 """
Original file line number Diff line number Diff line change 1+ Fix a bug in the previous bugfix that caused IDLE to not start when run with
2+ 3.10.8, 3.12.0a1, and at least Microsoft Python 3.10.2288.0 installed
3+ without the Lib/test package. 3.11.0 was never affected.
You can’t perform that action at this time.
0 commit comments