File tree 3 files changed +34
-16
lines changed
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
4
4
=========================
5
5
6
6
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
+
7
12
gh-65802: Document handling of extensions in Save As dialogs.
8
13
9
14
gh-95191: Include prompts when saving Shell (interactive input/output).
Original file line number Diff line number Diff line change 4
4
from os .path import expanduser
5
5
import plistlib
6
6
from sys import platform # Used in _init_tk_type, changed by test.
7
- from test .support import requires , ResourceDenied
8
7
9
8
import tkinter
10
9
16
15
17
16
def _init_tk_type ():
18
17
""" Initialize _tk_type for isXyzTk functions.
18
+
19
+ This function is only called once, when _tk_type is still None.
19
20
"""
20
21
global _tk_type
21
22
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 :
34
33
_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 ()
38
47
else :
39
48
_tk_type = "other"
49
+ return
40
50
41
51
def isAquaTk ():
42
52
"""
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