[pypy-svn] r42005 - in pypy/dist/pypy/module: __builtin__ unicodedata

fijal at codespeak.net fijal at codespeak.net
Thu Apr 12 19:51:08 CEST 2007


Author: fijal
Date: Thu Apr 12 19:51:08 2007
New Revision: 42005

Modified:
   pypy/dist/pypy/module/__builtin__/operation.py
   pypy/dist/pypy/module/unicodedata/interp_ucd.py
Log:
Use list[unichr] as a parameter of space.newunicode


Modified: pypy/dist/pypy/module/__builtin__/operation.py
==============================================================================
--- pypy/dist/pypy/module/__builtin__/operation.py	(original)
+++ pypy/dist/pypy/module/__builtin__/operation.py	Thu Apr 12 19:51:08 2007
@@ -4,7 +4,8 @@
 
 from pypy.interpreter import gateway
 from pypy.interpreter.baseobjspace import ObjSpace
-from pypy.interpreter.error import OperationError 
+from pypy.interpreter.error import OperationError
+import __builtin__
 NoneNotWrapped = gateway.NoneNotWrapped
 
 def abs(space, w_val):
@@ -18,7 +19,7 @@
 
 def unichr(space, w_code):
     "Return a Unicode string of one character with the given ordinal."
-    return space.newunicode([space.int_w(w_code)])
+    return space.newunicode([__builtin__.unichr(space.int_w(w_code))])
 
 def len(space, w_obj):
     "len(object) -> integer\n\nReturn the number of items of a sequence or mapping."

Modified: pypy/dist/pypy/module/unicodedata/interp_ucd.py
==============================================================================
--- pypy/dist/pypy/module/unicodedata/interp_ucd.py	(original)
+++ pypy/dist/pypy/module/unicodedata/interp_ucd.py	Thu Apr 12 19:51:08 2007
@@ -215,10 +215,10 @@
                 result[0] = ch
 
         if not composed: # If decomposed normalization we are done
-            return space.newunicode(result[:j])
+            return space.newunicode([unichr(i) for i in result[:j]])
 
         if j <= 1:
-            return space.newunicode(result[:j])
+            return space.newunicode([unichr(i) for i in result[:j]])
 
         current = result[0]
         starter_pos = 0
@@ -268,7 +268,7 @@
 
         result[starter_pos] = current
 
-        return space.newunicode(result[:next_insert])
+        return space.newunicode([unichr(i) for i in result[:next_insert]])
     normalize.unwrap_spec = ['self', ObjSpace, str, W_Root]
     
 



More information about the Pypy-commit mailing list