From a0e8af9de37d1631562a6ce43bd778575d70bd69 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 51f88825f..9ba7e2319 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")