summaryrefslogtreecommitdiffstats
path: root/src/engine/SCons/compat/_scons_optparse.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/engine/SCons/compat/_scons_optparse.py')
-rw-r--r--src/engine/SCons/compat/_scons_optparse.py20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/engine/SCons/compat/_scons_optparse.py b/src/engine/SCons/compat/_scons_optparse.py
index 9c3df52..db6fd0d 100644
--- a/src/engine/SCons/compat/_scons_optparse.py
+++ b/src/engine/SCons/compat/_scons_optparse.py
@@ -257,10 +257,10 @@ class HelpFormatter:
self.level = 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):
"""
@@ -831,7 +831,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
@@ -902,7 +902,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)
@@ -981,7 +981,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):
@@ -1036,9 +1036,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)
@@ -1347,11 +1347,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