Don't base64-encode integers

This is a temporary fix until we either use Params to determine
output type or treat integers differently from other binary values
internally (as unicode instead of str, for example).
This commit is contained in:
Rob Crittenden 2010-02-16 22:56:15 -05:00 committed by Jason Gerard DeRose
parent f52c671ca1
commit 7ccac40175

View File

@ -145,7 +145,11 @@ class textui(backend.Backend):
if it is a python str type, otherwise it is a plain string.
"""
if type(value) is str:
return base64.b64encode(value)
try:
int(value)
return value
except ValueError:
return base64.b64encode(value)
else:
return value