Author: Alex
Date: 2011-10-11 10:36:05 -0700 (Tue, 11 Oct 2011)
New Revision: 16957
Modified:
django/trunk/django/template/base.py
django/trunk/django/utils/encoding.py
Log:
Change some string literals to be unicode, because:
* It's the most micro of optimizations (forget I even said it)
* It makes significantly more sense semantically, given these are functions
which return unicode.
Modified: django/trunk/django/template/base.py
===================================================================
--- django/trunk/django/template/base.py 2011-10-10 22:19:59 UTC (rev
16956)
+++ django/trunk/django/template/base.py 2011-10-11 17:36:05 UTC (rev
16957)
@@ -817,7 +817,7 @@
bits.append(self.render_node(node, context))
else:
bits.append(node)
- return mark_safe(''.join([force_unicode(b) for b in bits]))
+ return mark_safe(u''.join([force_unicode(b) for b in bits]))
def get_nodes_by_type(self, nodetype):
"Return a list of all nodes of the given type"
Modified: django/trunk/django/utils/encoding.py
===================================================================
--- django/trunk/django/utils/encoding.py 2011-10-10 22:19:59 UTC (rev
16956)
+++ django/trunk/django/utils/encoding.py 2011-10-11 17:36:05 UTC (rev
16957)
@@ -81,7 +81,7 @@
# without raising a further exception. We do an
# approximation to what the Exception's standard str()
# output should be.
- s = ' '.join([force_unicode(arg, encoding, strings_only,
+ s = u' '.join([force_unicode(arg, encoding, strings_only,
errors) for arg in s])
elif not isinstance(s, unicode):
# Note: We use .decode() here, instead of unicode(s, encoding,
@@ -97,7 +97,7 @@
# working unicode method. Try to handle this without raising a
# further exception by individually forcing the exception args
# to unicode.
- s = ' '.join([force_unicode(arg, encoding, strings_only,
+ s = u' '.join([force_unicode(arg, encoding, strings_only,
errors) for arg in s])
return s
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en.