Add handling a string response

To avoid AttributeError when variable to_return is a string with a value "Pull queued for background execution."
pull/98/head
Alex Bolshakov 2017-07-12 12:51:26 +03:00 committed by GitHub
parent 9fc631cc85
commit 8b0c379b7f
1 changed files with 1 additions and 1 deletions

View File

@ -206,7 +206,7 @@ class PyMISP(object):
raise PyMISPError('Unknown error: {}'.format(response.text))
errors = []
if isinstance(to_return, list):
if isinstance(to_return, (list, str)):
to_return = {'response': to_return}
if to_return.get('error'):
if not isinstance(to_return['error'], list):