[pypy-commit] pypy refactor-buffer-api: fix translation

bdkearns noreply at buildbot.pypy.org
Thu Apr 24 04:01:39 CEST 2014


Author: Brian Kearns <bdkearns at gmail.com>
Branch: refactor-buffer-api
Changeset: r70914:820aa0f69a94
Date: 2014-04-23 22:01 -0400
http://bitbucket.org/pypy/pypy/changeset/820aa0f69a94/

Log:	fix translation

diff --git a/pypy/interpreter/baseobjspace.py b/pypy/interpreter/baseobjspace.py
--- a/pypy/interpreter/baseobjspace.py
+++ b/pypy/interpreter/baseobjspace.py
@@ -1449,11 +1449,15 @@
         try:
             buf = w_obj.buffer_w(self, 0)
         except TypeError:
-            try:
-                buf = w_obj.readbuf_w(self)
-            except TypeError:
-                self._getarg_error("string or buffer", w_obj)
-        return buf.as_str()
+            pass
+        else:
+            return buf.as_str()
+        try:
+            buf = w_obj.readbuf_w(self)
+        except TypeError:
+            self._getarg_error("string or buffer", w_obj)
+        else:
+            return buf.as_str()
 
     def str_or_None_w(self, w_obj):
         if self.is_w(w_obj, self.w_None):


More information about the pypy-commit mailing list