[pypy-svn] r31384 - in pypy/dist/pypy/rpython/rctypes: . test

ac at codespeak.net ac at codespeak.net
Thu Aug 17 22:47:37 CEST 2006


Author: ac
Date: Thu Aug 17 22:47:35 2006
New Revision: 31384

Modified:
   pypy/dist/pypy/rpython/rctypes/rstringbuf.py
   pypy/dist/pypy/rpython/rctypes/test/test_rstringbuf.py
Log:
Support assignment to stringbuf.raw

Modified: pypy/dist/pypy/rpython/rctypes/rstringbuf.py
==============================================================================
--- pypy/dist/pypy/rpython/rctypes/rstringbuf.py	(original)
+++ pypy/dist/pypy/rpython/rctypes/rstringbuf.py	Thu Aug 17 22:47:35 2006
@@ -32,7 +32,7 @@
     def rtype_setattr(self, hop):
         s_attr = hop.args_s[1]
         assert s_attr.is_constant()
-        assert s_attr.const == 'value'
+        assert s_attr.const in ('value', 'raw')
         v_box, v_attr, v_value = hop.inputargs(self, lltype.Void, string_repr)
         hop.gendirectcall(ll_stringbuf_setvalue_from_string, v_box, v_value)
 

Modified: pypy/dist/pypy/rpython/rctypes/test/test_rstringbuf.py
==============================================================================
--- pypy/dist/pypy/rpython/rctypes/test/test_rstringbuf.py	(original)
+++ pypy/dist/pypy/rpython/rctypes/test/test_rstringbuf.py	Thu Aug 17 22:47:35 2006
@@ -142,6 +142,8 @@
             assert buf.value == 'abcde'
             buf.value = 'x'
             assert buf.value == 'x'
+            buf.raw = 'y'
+            assert buf.value == 'y'
             return ord(buf[2])
 
         res = interpret(func, [12])



More information about the Pypy-commit mailing list