Fix docstring construction in alias_function when Salt installed using -OO

This removes the docstring, so fun.__doc__ is None, which raises an
exception when we try to concatenate these.
This commit is contained in:
Erik Johnson 2018-06-20 10:45:18 -05:00
parent 6929423528
commit 90c90f5d5c
No known key found for this signature in database
GPG key ID: 5E5583C437808F3F

View file

@ -2360,7 +2360,7 @@ def alias_function(fun, name, doc=None):
orig_name = fun.__name__
alias_msg = ('\nThis function is an alias of '
'``{0}``.\n'.format(orig_name))
alias_fun.__doc__ = alias_msg + fun.__doc__
alias_fun.__doc__ = alias_msg + (fun.__doc__ or '')
return alias_fun