[pypy-svn] r76499 - pypy/trunk/pypy/rpython

arigo at codespeak.net arigo at codespeak.net
Fri Aug 6 11:22:13 CEST 2010


Author: arigo
Date: Fri Aug  6 11:22:12 2010
New Revision: 76499

Modified:
   pypy/trunk/pypy/rpython/rstr.py
Log:
Fix for r76143.


Modified: pypy/trunk/pypy/rpython/rstr.py
==============================================================================
--- pypy/trunk/pypy/rpython/rstr.py	(original)
+++ pypy/trunk/pypy/rpython/rstr.py	Fri Aug  6 11:22:12 2010
@@ -288,8 +288,8 @@
         if not hop.args_s[1].is_constant():
             raise TyperError("encoding must be constant")
         encoding = hop.args_s[1].const
-        if encoding == "ascii":
-            expect = self.lowleveltype   # can be a UniChar
+        if encoding == "ascii" and self.lowleveltype == UniChar:
+            expect = UniChar             # only for unichar.encode('ascii')
         else:
             expect = self.repr           # must be a regular unicode string
         v_self = hop.inputarg(expect, 0)



More information about the Pypy-commit mailing list