From 45c7dacfaa7878004d7fa78374cc3a9f55aa0463 Mon Sep 17 00:00:00 2001 From: Grazfather Date: Sat, 26 Aug 2023 11:39:19 -0400 Subject: [PATCH] Raise ValueErrors --- gef.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gef.py b/gef.py index ecd88c018..c152ce45f 100644 --- a/gef.py +++ b/gef.py @@ -1936,7 +1936,7 @@ def __exit__(self, *exc: Any) -> None: class RedirectOutputContext: def __init__(self, to_file: str = "/dev/null") -> None: - if " " in to_file: raise Exception("Target filepath cannot contain spaces") + if " " in to_file: raise ValueEror("Target filepath cannot contain spaces") self.redirection_target_file = to_file return @@ -1957,7 +1957,7 @@ def __exit__(self, *exc: Any) -> None: def enable_redirect_output(to_file: str = "/dev/null") -> None: """Redirect all GDB output to `to_file` parameter. By default, `to_file` redirects to `/dev/null`.""" - if " " in to_file: raise Exception("Target filepath cannot contain spaces") + if " " in to_file: raise ValueEror("Target filepath cannot contain spaces") gdb.execute("set logging overwrite") gdb.execute(f"set logging file {to_file}") gdb.execute("set logging redirect on")