Skip to content

Commit 81975d8

Browse files
committed
address second code review comments
1 parent deb0ca9 commit 81975d8

2 files changed

Lines changed: 9 additions & 2 deletions

File tree

Lib/idlelib/macosx.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,9 @@ def readSystemPreferences():
9393
"""
9494
Fetch the macOS system preferences.
9595
"""
96+
if platform != 'darwin':
97+
return None
98+
9699
plist_path = expanduser('~/Library/Preferences/.GlobalPreferences.plist')
97100
try:
98101
with open(plist_path, 'rb') as plist_file:
@@ -105,12 +108,15 @@ def preferTabsPreferenceWarning():
105108
"""
106109
Warn if "Prefer tabs when opening documents" is set to "Always".
107110
"""
111+
if platform != 'darwin':
112+
return None
113+
108114
prefs = readSystemPreferences()
109115
if prefs and prefs.get('AppleWindowTabbingMode') == 'always':
110116
return (
111117
'WARNING: The system preference "Prefer tabs when opening'
112118
' documents" is set to "Always". This will cause various problems'
113-
' with IDLE. For the best experience, change this setting before'
119+
' with IDLE. For the best experience, change this setting when'
114120
' running IDLE (via System Preferences -> Dock).'
115121
)
116122
return None
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
On macOS, warn if "Prefer tabs when opening documents" is set to "Always".
1+
On macOS, warn if the system preference "Prefer tabs when opening documents"
2+
is set to "Always".

0 commit comments

Comments
 (0)