[pypy-commit] pypy py3k: Translation fix.

amauryfa noreply at buildbot.pypy.org
Tue Sep 25 00:33:18 CEST 2012


Author: Amaury Forgeot d'Arc <amauryfa at gmail.com>
Branch: py3k
Changeset: r57539:b1fcf7f44eca
Date: 2012-09-25 00:32 +0200
http://bitbucket.org/pypy/pypy/changeset/b1fcf7f44eca/

Log:	Translation fix.

diff --git a/pypy/objspace/std/unicodeobject.py b/pypy/objspace/std/unicodeobject.py
--- a/pypy/objspace/std/unicodeobject.py
+++ b/pypy/objspace/std/unicodeobject.py
@@ -64,14 +64,17 @@
         return self._value
 
     def identifier_w(self, space):
-        if self._utf8 is None:
-            from pypy.objspace.std.unicodetype import encode_error_handler
-            from pypy.rlib.runicode import unicode_encode_utf_8
-            u = self._value
-            eh = encode_error_handler(space)
-            self._utf8 = unicode_encode_utf_8(u, len(u), None,
-                                              errorhandler=eh)
-        return self._utf8
+        identifier = self._utf8
+        if identifier is not None:
+            return identifier
+        from pypy.objspace.std.unicodetype import encode_error_handler
+        from pypy.rlib.runicode import unicode_encode_utf_8
+        u = self._value
+        eh = encode_error_handler(space)
+        identifier = unicode_encode_utf_8(u, len(u), None,
+                                          errorhandler=eh)
+        self._utf8 = identifier
+        return identifier
 
 W_UnicodeObject.EMPTY = W_UnicodeObject(u'')
 


More information about the pypy-commit mailing list