change isinstance(obj, (str, unicode)) to isinstance(obj, basestring)

as suggested by Piotr Ożarowski
This commit is contained in:
jan.dittberner 2009-06-07 15:48:44 +00:00
parent afc0c6588e
commit a626f5b1b9

View File

@ -33,7 +33,7 @@ def load_model(dotted_name):
def asbool(obj):
"""Do everything to use object as bool"""
if isinstance(obj, (str, unicode)):
if isinstance(obj, basestring):
obj = obj.strip().lower()
if obj in ['true', 'yes', 'on', 'y', 't', '1']:
return True