Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c92cdf7

Browse files
committed
The sys.platform identifier for Windows is just 'win32' (for all varieties).
1 parent 7dcf84f commit c92cdf7

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

Lib/pydoc.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -801,8 +801,8 @@ def getpager():
801801
return plainpager
802802
if os.environ.has_key('PAGER'):
803803
return lambda a: pipepager(a, os.environ['PAGER'])
804-
if sys.platform in ['win', 'win32', 'nt']:
805-
return lambda a: tempfilepager(a, 'more')
804+
if sys.platform == 'win32':
805+
return lambda a: tempfilepager(a, 'more <')
806806
if hasattr(os, 'system') and os.system('less 2>/dev/null') == 0:
807807
return lambda a: pipepager(a, 'less')
808808

@@ -835,7 +835,7 @@ def tempfilepager(text, cmd):
835835
file.write(text)
836836
file.close()
837837
try:
838-
os.system(cmd + ' <' + filename)
838+
os.system(cmd + ' ' + filename)
839839
finally:
840840
os.unlink(filename)
841841

@@ -1193,7 +1193,7 @@ def __init__(self, window, port=7464):
11931193
self.stop_btn = Tkinter.Button(self.search_frm,
11941194
text='stop', pady=0, command=self.stop, state='disabled')
11951195
if sys.platform == 'win32':
1196-
# Attempting to hide and show this button crashes under Windows.
1196+
# Trying to hide and show this button crashes under Windows.
11971197
self.stop_btn.pack(side='right')
11981198

11991199
self.window.title('pydoc')
@@ -1208,7 +1208,7 @@ def __init__(self, window, port=7464):
12081208
self.search_frm.pack(side='top', fill='x')
12091209
self.search_ent.focus_set()
12101210

1211-
font = ('helvetica', sys.platform in ['win32', 'win', 'nt'] and 8 or 10)
1211+
font = ('helvetica', sys.platform == 'win32' and 8 or 10)
12121212
self.result_lst = Tkinter.Listbox(window, font=font, height=6)
12131213
self.result_lst.bind('<Button-1>', self.select)
12141214
self.result_lst.bind('<Double-Button-1>', self.goto)
@@ -1252,7 +1252,7 @@ def open(self, event=None, url=None):
12521252
import webbrowser
12531253
webbrowser.open(url)
12541254
except ImportError: # pre-webbrowser.py compatibility
1255-
if sys.platform in ['win', 'win32', 'nt']:
1255+
if sys.platform == 'win32':
12561256
os.system('start "%s"' % url)
12571257
elif sys.platform == 'mac':
12581258
try:
@@ -1353,8 +1353,8 @@ def cli():
13531353
class BadUsage: pass
13541354

13551355
try:
1356-
if sys.platform in ['mac', 'win', 'win32', 'nt'] and not sys.argv[1:]:
1357-
# CLI-less platforms
1356+
if sys.platform in ['mac', 'win32'] and not sys.argv[1:]:
1357+
# graphical platforms with threading (and no CLI)
13581358
gui()
13591359
return
13601360

0 commit comments

Comments
 (0)