1. Pypy
  2. Untitled project
  3. pypy


Brian Kearns  committed 33a8fc6

kill bufferchar_w

  • Participants
  • Parent commits e217891
  • Branches refactor-buffer-api

Comments (0)

Files changed (2)

File pypy/interpreter/baseobjspace.py

View file
             assert False
-    # XXX rename these/replace with code more like CPython getargs for buffers
+    # XXX rename/replace with code more like CPython getargs for buffers
     def bufferstr_w(self, w_obj):
         # Directly returns an interp-level str.  Note that if w_obj is a
         # unicode string, this is different from str_w(buffer(w_obj)):
                 self._getarg_error("string or buffer", w_obj)
         return buf.as_str()
-    def bufferchar_w(self, w_obj):
-        try:
-            return self.str_w(w_obj)
-        except OperationError, e:
-            if not e.match(self, self.w_TypeError):
-                raise
-        return self.charbuf_w(w_obj)
     def str_or_None_w(self, w_obj):
         if self.is_w(w_obj, self.w_None):
             return None

File pypy/objspace/std/bytesobject.py

View file
     def _val(self, space):
         return self._value
-    def _op_val(self, space, w_other):
-        return space.bufferchar_w(w_other)
+    @staticmethod
+    def _op_val(space, w_other):
+        try:
+            return space.str_w(w_other)
+        except OperationError, e:
+            if not e.match(space, space.w_TypeError):
+                raise
+        return space.charbuf_w(w_other)
     def _chr(self, char):
         assert len(char) == 1