Author: Raffael Tfirst <[email protected]>
Branch: py3.5-async
Changeset: r85794:0ffa9890650b
Date: 2016-07-21 20:17 +0200
http://bitbucket.org/pypy/pypy/changeset/0ffa9890650b/

Log:    Fix type of new memoryview format (Unicodeobject -> String)

diff --git a/pypy/objspace/std/memoryobject.py 
b/pypy/objspace/std/memoryobject.py
--- a/pypy/objspace/std/memoryobject.py
+++ b/pypy/objspace/std/memoryobject.py
@@ -200,10 +200,10 @@
         from rpython.rtyper.lltypesystem import rffi
         from sys import getsizeof
         size = -1
-        if fmt._val(fmt)[0] == '@':
-            f = fmt._val(fmt)[1]
+        if fmt[0] == '@':
+            f = fmt[1]
         else:
-            f = fmt._val(fmt)[0]
+            f = fmt[0]
         if f == 'c' or f == 'b' or f == 'B':
             size = rffi.sizeof(rffi.CHAR)
         elif f == 'h' or f == 'H':
@@ -228,8 +228,8 @@
     
     def descr_cast(self, space, w_args, **w_kwds):
         self._check_released(space)
-        newitemsize = self.get_native_fmtchar(w_args)
-        mv = W_MemoryView(self.buf, w_args, newitemsize)
+        newitemsize = self.get_native_fmtchar(w_args._val(w_args))
+        mv = W_MemoryView(self.buf, w_args._val(w_args), newitemsize)
         return mv
 
 
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to