Permalink
Browse files

ENH: odr: update 'raise' statements

  • Loading branch information...
1 parent 66efe90 commit aec416b4927b32e1837f433b5628977c1b8299b3 warren.weckesser committed Nov 20, 2010
Showing with 6 additions and 6 deletions.
  1. +6 −6 scipy/odr/odrpack.py
View
@@ -316,7 +316,7 @@ def __getattr__(self, attr):
if attr in self.meta.keys():
return self.meta[attr]
else:
- raise AttributeError, "'%s' not in metadata" % attr
+ raise AttributeError("'%s' not in metadata" % attr)
class RealData(Data):
@@ -355,9 +355,9 @@ class RealData(Data):
def __init__(self, x, y=None, sx=None, sy=None, covx=None, covy=None,
fix=None, meta={}):
if (sx is not None) and (covx is not None):
- raise ValueError, "cannot set both sx and covx"
+ raise ValueError("cannot set both sx and covx")
if (sy is not None) and (covy is not None):
- raise ValueError, "cannot set both sy and covy"
+ raise ValueError("cannot set both sy and covy")
# Set flags for __getattr__
self._ga_flags = {}
@@ -414,7 +414,7 @@ def __getattr__(self, attr):
if attr in self.meta.keys():
return self.meta[attr]
else:
- raise AttributeError, "'%s' not in metadata" % attr
+ raise AttributeError("'%s' not in metadata" % attr)
else:
func, arg = lookup_tbl[(attr, self._ga_flags[attr])]
@@ -528,7 +528,7 @@ def __getattr__(self, attr):
if attr in self.meta.keys():
return self.meta[attr]
else:
- raise AttributeError, "'%s' not in metadata" % attr
+ raise AttributeError("'%s' not in metadata" % attr)
class Output(object):
@@ -1101,7 +1101,7 @@ def restart(self, iter=None):
"""
if self.output is None:
- raise odr_error, "cannot restart: run() has not been called before"
+ raise odr_error("cannot restart: run() has not been called before")
self.set_job(restart=1)
self.work = self.output.work

0 comments on commit aec416b

Please sign in to comment.