[pypy-commit] pypy remove-remaining-smm: Inline this constant.
Manuel Jacob
noreply at buildbot.pypy.org
Mon Feb 24 21:56:09 CET 2014
Author: Manuel Jacob
Branch: remove-remaining-smm
Changeset: r69368:57581836303c
Date: 2014-02-24 21:40 +0100
http://bitbucket.org/pypy/pypy/changeset/57581836303c/
Log: Inline this constant.
diff --git a/pypy/objspace/std/complexobject.py b/pypy/objspace/std/complexobject.py
--- a/pypy/objspace/std/complexobject.py
+++ b/pypy/objspace/std/complexobject.py
@@ -171,9 +171,6 @@
return (space.float_w(space.float(w_complex)), 0.0)
-ERR_MALFORMED = "complex() arg is a malformed string"
-
-
class W_ComplexObject(W_Root):
_immutable_fields_ = ['realval', 'imagval']
@@ -301,12 +298,14 @@
try:
realstr, imagstr = _split_complex(space.str_w(w_real))
except ValueError:
- raise oefmt(space.w_ValueError, ERR_MALFORMED)
+ raise oefmt(space.w_ValueError,
+ "complex() arg is a malformed string")
try:
realval = string_to_float(realstr)
imagval = string_to_float(imagstr)
except ParseStringError:
- raise oefmt(space.w_ValueError, ERR_MALFORMED)
+ raise oefmt(space.w_ValueError,
+ "complex() arg is a malformed string")
else:
# non-string arguments
More information about the pypy-commit
mailing list