1
0
mirror of https://github.com/django/django.git synced 2024-12-22 17:16:24 +00:00

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

View File

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