Skip to content

Commit

Permalink
Raise ValueErrors
Browse files Browse the repository at this point in the history
  • Loading branch information
Grazfather committed Aug 29, 2023
1 parent 9c6d0fc commit 45c7dac
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions gef.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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")
Expand Down

0 comments on commit 45c7dac

Please sign in to comment.