[pypy-svn] r27624 - pypy/dist/pypy/objspace/std

arigo at codespeak.net arigo at codespeak.net
Tue May 23 17:32:10 CEST 2006


Author: arigo
Date: Tue May 23 17:32:09 2006
New Revision: 27624

Modified:
   pypy/dist/pypy/objspace/std/unicodeobject.py
   pypy/dist/pypy/objspace/std/unicodetype.py
Log:
This 'import codecs' caused geninterp to freeze a codecs function from
the ambiant stdlib into the _cache!  Crash with 2.5 where its body
changed to accomodate for a change in _codecs that our own
2.4-compatible _codecs does not provide.



Modified: pypy/dist/pypy/objspace/std/unicodeobject.py
==============================================================================
--- pypy/dist/pypy/objspace/std/unicodeobject.py	(original)
+++ pypy/dist/pypy/objspace/std/unicodeobject.py	Tue May 23 17:32:09 2006
@@ -510,6 +510,7 @@
     try:
         w_unichar = unicodetype.unicode_from_object(space, w_char)
     except OperationError:
+        # XXX don't completely eat this exception
         raise OperationError(space.w_TypeError, space.wrap('The fill character cannot be converted to Unicode'))
 
     if space.int_w(space.len(w_unichar)) != 1:

Modified: pypy/dist/pypy/objspace/std/unicodetype.py
==============================================================================
--- pypy/dist/pypy/objspace/std/unicodetype.py	(original)
+++ pypy/dist/pypy/objspace/std/unicodetype.py	Tue May 23 17:32:09 2006
@@ -45,9 +45,8 @@
 # ____________________________________________________________
 
 app = gateway.applevel('''
-import codecs, sys
-
 def unicode_from_encoded_object(obj, encoding, errors):
+    import codecs, sys
     if encoding is None:
         encoding = sys.getdefaultencoding()
     decoder = codecs.getdecoder(encoding)



More information about the Pypy-commit mailing list