diff options
author | Collin Winter <collinw@gmail.com> | 2007-08-30 01:19:48 +0000 |
---|---|---|
committer | Collin Winter <collinw@gmail.com> | 2007-08-30 01:19:48 +0000 |
commit | ce36ad8a467d914eb5c91f33835b9eaea18ee93b (patch) | |
tree | 05bf654f3359e20b455dc300bd860bba5d291c8d /Lib/optparse.py | |
parent | Copying the email package back, despite its failings. (diff) | |
download | cpython-ce36ad8a467d914eb5c91f33835b9eaea18ee93b.tar.gz cpython-ce36ad8a467d914eb5c91f33835b9eaea18ee93b.tar.bz2 cpython-ce36ad8a467d914eb5c91f33835b9eaea18ee93b.zip |
Raise statement normalization in Lib/.
Diffstat (limited to 'Lib/optparse.py')
-rw-r--r-- | Lib/optparse.py | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/Lib/optparse.py b/Lib/optparse.py index bae10500d34..b3de41157bf 100644 --- a/Lib/optparse.py +++ b/Lib/optparse.py @@ -239,10 +239,10 @@ class HelpFormatter: self.level -= 1 def format_usage(self, usage): - raise NotImplementedError, "subclasses must implement" + raise NotImplementedError("subclasses must implement") def format_heading(self, heading): - raise NotImplementedError, "subclasses must implement" + raise NotImplementedError("subclasses must implement") def _format_text(self, text): """ @@ -805,7 +805,7 @@ class Option: parser.print_version() parser.exit() else: - raise RuntimeError, "unknown action %r" % self.action + raise RuntimeError("unknown action %r" % self.action) return 1 @@ -865,7 +865,7 @@ class Values: elif mode == "loose": self._update_loose(dict) else: - raise ValueError, "invalid update mode: %r" % mode + raise ValueError("invalid update mode: %r" % mode) def read_module(self, modname, mode="careful"): __import__(modname) @@ -944,7 +944,7 @@ class OptionContainer: def set_conflict_handler(self, handler): if handler not in ("error", "resolve"): - raise ValueError, "invalid conflict_resolution value %r" % handler + raise ValueError("invalid conflict_resolution value %r" % handler) self.conflict_handler = handler def set_description(self, description): @@ -999,9 +999,9 @@ class OptionContainer: elif len(args) == 1 and not kwargs: option = args[0] if not isinstance(option, Option): - raise TypeError, "not an Option instance: %r" % option + raise TypeError("not an Option instance: %r" % option) else: - raise TypeError, "invalid arguments" + raise TypeError("invalid arguments") self._check_conflict(option) @@ -1310,11 +1310,11 @@ class OptionParser (OptionContainer): elif len(args) == 1 and not kwargs: group = args[0] if not isinstance(group, OptionGroup): - raise TypeError, "not an OptionGroup instance: %r" % group + raise TypeError("not an OptionGroup instance: %r" % group) if group.parser is not self: - raise ValueError, "invalid OptionGroup (wrong parser)" + raise ValueError("invalid OptionGroup (wrong parser)") else: - raise TypeError, "invalid arguments" + raise TypeError("invalid arguments") self.option_groups.append(group) return group |