diff options
author | Aaron Bentley <abentley@panoramicfeedback.com> | 2005-05-17 13:29:15 +0000 |
---|---|---|
committer | Aaron Bentley <abentley@panoramicfeedback.com> | 2005-05-17 13:29:15 +0000 |
commit | 757eb3a2249ca2aa7b0cd627c9ea884a2d9b1eac (patch) | |
tree | b857222f156ea5aea857e24775750013b65064f9 /libbe | |
parent | 5c39f0d8175f2ef57422c76ff6fcd20ae7dff7cb (diff) | |
download | bugseverywhere-757eb3a2249ca2aa7b0cd627c9ea884a2d9b1eac.tar.gz |
Fixed bug handing missing $EDITOR
Diffstat (limited to 'libbe')
-rw-r--r-- | libbe/utility.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/libbe/utility.py b/libbe/utility.py index 5a5cb40..a31d5d8 100644 --- a/libbe/utility.py +++ b/libbe/utility.py @@ -94,14 +94,16 @@ def str_to_time(str_time): 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) |