Updated string quoting

Converts passed integers and bool to string, used to prevent string.encode() from erroring.
master
TuxPowered 2015-11-14 12:26:07 -08:00
parent cef87f4241
commit 1481fb215f
1 changed files with 3 additions and 0 deletions

View File

@ -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):