Author: Philip Jenvey <[email protected]>
Branch: py3k
Changeset: r64672:868044c336bd
Date: 2013-05-30 13:19 -0700
http://bitbucket.org/pypy/pypy/changeset/868044c336bd/

Log:    simplify

diff --git a/pypy/module/__builtin__/functional.py 
b/pypy/module/__builtin__/functional.py
--- a/pypy/module/__builtin__/functional.py
+++ b/pypy/module/__builtin__/functional.py
@@ -4,7 +4,7 @@
 """
 
 from pypy.interpreter.baseobjspace import W_Root
-from pypy.interpreter.error import OperationError
+from pypy.interpreter.error import OperationError, operationerrfmt
 from pypy.interpreter.gateway import interp2app, unwrap_spec, WrappedDefault
 from pypy.interpreter.typedef import TypeDef
 from rpython.rlib import jit
@@ -442,9 +442,8 @@
             return space.sequence_index(self, w_item)
 
         if not self._contains_long(space, w_item):
-            item_repr = space.unicode_w(space.repr(w_item))
-            msg = u"%s is not in range" % item_repr
-            raise OperationError(space.w_ValueError, space.wrap(msg))
+            raise operationerrfmt(space.w_ValueError, "%R is not in range",
+                                  w_item)
         w_index = space.sub(w_item, self.w_start)
         return space.floordiv(w_index, self.w_step)
 
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to