Author: Alex Gaynor <[email protected]>
Branch: stdlib-2.7.11
Changeset: r83202:9a6a7a6afb33
Date: 2016-03-20 17:33 -0400
http://bitbucket.org/pypy/pypy/changeset/9a6a7a6afb33/
Log: merged upstream
diff --git a/pypy/module/_random/interp_random.py
b/pypy/module/_random/interp_random.py
--- a/pypy/module/_random/interp_random.py
+++ b/pypy/module/_random/interp_random.py
@@ -1,6 +1,6 @@
import time
-from pypy.interpreter.error import OperationError
+from pypy.interpreter.error import OperationError, oefmt
from pypy.interpreter.typedef import TypeDef
from pypy.interpreter.gateway import interp2app, unwrap_spec
from pypy.interpreter.baseobjspace import W_Root
@@ -77,7 +77,7 @@
w_item = space.getitem(w_state, space.newint(rrandom.N))
index = space.int_w(w_item)
if index < 0 or index > rrandom.N:
- raise OperationError(space.w_ValueError, space.wrap("invalid
state"))
+ raise oefmt(space.w_ValueError, "invalid state")
self._rnd.index = index
def jumpahead(self, space, w_n):
diff --git a/pypy/module/array/interp_array.py
b/pypy/module/array/interp_array.py
--- a/pypy/module/array/interp_array.py
+++ b/pypy/module/array/interp_array.py
@@ -239,10 +239,8 @@
values,as if it had been read from a file using the fromfile() method).
"""
if self is w_s:
- raise OperationError(
- self.space.w_ValueError,
- self.space.wrap("array.fromstring(x): x cannot be self")
- )
+ raise oefmt(space.w_ValueError,
+ "array.fromstring(x): x cannot be self")
s = space.getarg_w('s#', w_s)
if len(s) % self.itemsize != 0:
msg = 'string length not a multiple of item size'
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit