Merge pull request #110 from spacepatcher/master

Add handling a string response
pull/98/head
Raphaël Vinot 2017-07-12 12:00:37 +02:00 committed by GitHub
commit e96f540041
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)) raise PyMISPError('Unknown error: {}'.format(response.text))
errors = [] errors = []
if isinstance(to_return, list): if isinstance(to_return, (list, str)):
to_return = {'response': to_return} to_return = {'response': to_return}
if to_return.get('error'): if to_return.get('error'):
if not isinstance(to_return['error'], list): if not isinstance(to_return['error'], list):