From 1481fb215f1bf22e404a329e764597e750615c24 Mon Sep 17 00:00:00 2001 From: TuxPowered Date: Sat, 14 Nov 2015 12:26:07 -0800 Subject: [PATCH] Updated string quoting Converts passed integers and bool to string, used to prevent string.encode() from erroring. --- asterisk/agi.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/asterisk/agi.py b/asterisk/agi.py index 72f94da..d1dc39a 100644 --- a/asterisk/agi.py +++ b/asterisk/agi.py @@ -113,6 +113,9 @@ class AGI: sys.stderr.write('\n') def _quote(self, string): + """ provides double quotes to string, converts int/bool to string """ + if isinstance(string, int): + string = str(string) return ''.join(['"', string.encode('ascii', 'ignore'), '"']) def _handle_sighup(self, signum, frame):