[pypy-svn] pypy default: allow buffers here, too

gutworth commits-noreply at bitbucket.org
Thu Jan 20 21:36:41 CET 2011


Author: Benjamin Peterson <benjamin at python.org>
Branch: 
Changeset: r41093:e3fa58bc6ddc
Date: 2011-01-20 14:37 -0600
http://bitbucket.org/pypy/pypy/changeset/e3fa58bc6ddc/

Log:	allow buffers here, too

diff --git a/pypy/objspace/std/ropeobject.py b/pypy/objspace/std/ropeobject.py
--- a/pypy/objspace/std/ropeobject.py
+++ b/pypy/objspace/std/ropeobject.py
@@ -837,11 +837,10 @@
     remaining characters have been mapped through the given translation table,
     which must be a string of length 256"""
 
-    # XXX CPython accepts buffers, too, not sure what we should do
     if space.is_w(w_table, space.w_None):
         table = DEFAULT_NOOP_TABLE
     else:
-        table = space.str_w(w_table)
+        table = space.bufferstr_w(w_table)
         if len(table) != 256:
             raise OperationError(
                 space.w_ValueError,


More information about the Pypy-commit mailing list