Make sure values are strings before performing rstrip. Fixes #20641 (#20643)

This commit is contained in:
Matt Martz 2017-01-25 10:14:19 -06:00 committed by GitHub
parent e5f7a22215
commit 28e39ca42f

View file

@ -107,7 +107,7 @@ EXAMPLES = '''
def response_closure(module, question, responses):
resp_gen = (u'%s\n' % r.rstrip('\n').decode() for r in responses)
resp_gen = (u'%s\n' % str(r).rstrip('\n').decode() for r in responses)
def wrapped(info):
try:
@ -150,7 +150,7 @@ def main():
if isinstance(value, list):
response = response_closure(module, key, value)
else:
response = u'%s\n' % value.rstrip('\n').decode()
response = u'%s\n' % str(value).rstrip('\n').decode()
events[key.decode()] = response