--- /dev/null
+
+
+
+creator=abentley
+
+
+
+
+
+
+severity=minor
+
+
+
+
+
+
+status=open
+
+
+
+
+
+
+summary=no tests for --help, -h, help, etc.
+
+
+
+
+
+
+time=Tue, 17 May 2005 13:27:18 +0000
+
+
+
--- /dev/null
+
+
+
+creator=abentley
+
+
+
+
+
+
+severity=minor
+
+
+
+
+
+
+status=open
+
+
+
+
+
+
+summary=no tests for missing
+
+
+
+
+
+
+time=Tue, 17 May 2005 13:27:33 +0000
+
+
+
raise cmdutil.UsageError()
bug = cmdutil.get_bug(args[0])
if len(args) == 1:
- body = utility.editor_string()
+ try:
+ body = utility.editor_string()
+ except utility.CantFindEditor:
+ raise cmdutil.UserError(
+ "No comment supplied, and EDITOR not specified.")
if body is None:
raise cmdutil.UserError("No comment entered.")
else:
def handy_time(time_val):
return time.strftime("%a, %d %b %Y %H:%M", time.localtime(time_val))
+class CantFindEditor(Exception):
+ def __init__(self):
+ Exception.__init__(self, "Can't find editor to get string from")
+
def editor_string():
"""Invokes the editor, and returns the user_produced text as a string"""
try:
editor = os.environ["EDITOR"]
except KeyError:
- raise cmdutil.UserError(
- "No comment supplied, and EDITOR not specified.")
-
+ raise CantFindEditor()
fhandle, fname = tempfile.mkstemp()
try:
os.close(fhandle)