newforms: Tiny optimization to smart_unicode()

git-svn-id: http://code.djangoproject.com/svn/django/trunk@4077 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Adrian Holovaty 2006-11-16 06:47:08 +00:00
parent 6dd4e6d046
commit 820d940355
1 changed files with 1 additions and 1 deletions

View File

@ -4,7 +4,7 @@ DEFAULT_ENCODING = 'utf-8' # TODO: First look at django.conf.settings, then fall
def smart_unicode(s):
if not isinstance(s, basestring):
s = unicode(str(s))
if not isinstance(s, unicode):
elif not isinstance(s, unicode):
s = unicode(s, DEFAULT_ENCODING)
return s