option.help can be None

Handle the case where option.help is none, meaning we can't use
'startswith'.

Change-Id: I0d7dceeed89ad287b9786f04bf8dc9aba1b845dd
This commit is contained in:
Stephen Finucane 2017-03-22 15:35:18 +00:00
parent f9a8579b25
commit 81f7a8f75a
1 changed files with 2 additions and 1 deletions

View File

@ -459,8 +459,9 @@ def _format_opt(option):
opt_type = _TYPE_DESCRIPTIONS.get(type(option), 'Unknown')
flags = []
if (option.deprecated_for_removal or
option.help.startswith('DEPRECATED')):
(option.help and option.help.startswith('DEPRECATED'))):
flags.append(('Deprecated', deprecated_text))
if option.mutable:
flags.append(('Mutable', 'This option can be changed without'