From 8b0c379b7f96bd48ef88b8eda0b07285d1801434 Mon Sep 17 00:00:00 2001 From: Alex Bolshakov Date: Wed, 12 Jul 2017 12:51:26 +0300 Subject: [PATCH] Add handling a string response To avoid AttributeError when variable to_return is a string with a value "Pull queued for background execution." --- pymisp/api.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pymisp/api.py b/pymisp/api.py index 9268b19..d7da661 100644 --- a/pymisp/api.py +++ b/pymisp/api.py @@ -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):