Fix webUI command parameters error on Fedora 14.

This commit is contained in:
Pavel Zuna 2010-12-22 15:18:33 -05:00 committed by Adam Young
parent 671c070050
commit e5ccddf446

View File

@ -1014,7 +1014,7 @@ class Int(Number):
"""
if type(value) in (int, long):
return value
if type(value) is unicode:
if type(value) in (str, unicode):
# permit floating point strings
if value.find(u'.') >= 0:
try:
@ -1247,6 +1247,14 @@ class Str(Data):
"""
if type(value) is self.type:
return value
if type(value) is str:
try:
return value.decode('utf-8')
except UnicodeDecodeError:
raise ConversionError(
name=self.name, index=index,
error=ugettext(self.scalar_error)
)
if type(value) in (int, float):
return self.type(value)
if type(value) in (tuple, list):