mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
Turns out GetArgv() options can be 4-tuples too, with the last value being the default (or something like that). Cater for this.
Also put in a safeguard against very long help strings.
This commit is contained in:
parent
96cad2ea47
commit
09c7343273
1 changed files with 9 additions and 3 deletions
|
@ -361,12 +361,18 @@ def _selectoption(d, optionlist, idx):
|
|||
MacOS.SysBeep()
|
||||
return
|
||||
option = optionlist[idx]
|
||||
if type(option) == type(()) and \
|
||||
len(option) > 1:
|
||||
help = option[-1]
|
||||
if type(option) == type(()):
|
||||
if len(option) == 4:
|
||||
help = option[2]
|
||||
elif len(option) > 1:
|
||||
help = option[-1]
|
||||
else:
|
||||
help = ''
|
||||
else:
|
||||
help = ''
|
||||
h = d.GetDialogItemAsControl(ARGV_OPTION_EXPLAIN)
|
||||
if help and len(help) > 250:
|
||||
help = help[:250] + '...'
|
||||
Dlg.SetDialogItemText(h, help)
|
||||
hasvalue = 0
|
||||
if type(option) == type(()):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue