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")