Skip to content

Commit 96465a8

Browse files
committed
Raise ValueError instead of OSError when self.editor is not set.
1 parent fefb01e commit 96465a8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

cmd2/cmd2.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5358,10 +5358,10 @@ def run_editor(self, file_path: str | None = None) -> None:
53585358
"""Run a text editor and optionally open a file with it.
53595359
53605360
:param file_path: optional path of the file to edit. Defaults to None.
5361-
:raises EnvironmentError: if self.editor is not set
5361+
:raises ValueError: if self.editor is not set
53625362
"""
53635363
if not self.editor:
5364-
raise OSError("Please use 'set editor' to specify your text editing program of choice.")
5364+
raise ValueError("Please use 'set editor' to specify your text editing program of choice.")
53655365

53665366
command = su.quote(os.path.expanduser(self.editor))
53675367
if file_path:

0 commit comments

Comments
 (0)