Skip to content

Commit

Permalink
minor lint
Browse files Browse the repository at this point in the history
  • Loading branch information
hugsy committed Nov 7, 2024
1 parent 4ae683f commit 8130895
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions gef.py
Original file line number Diff line number Diff line change
Expand Up @@ -3723,6 +3723,8 @@ def new_objfile_handler(evt: "gdb.NewObjFileEvent | None") -> None:
path = progspace.filename
else:
raise RuntimeError("Cannot determine file path")

assert path
try:
if gef.session.root and path.startswith("target:"):
# If the process is in a container, replace the "target:" prefix
Expand Down Expand Up @@ -11385,7 +11387,7 @@ def file(self) -> pathlib.Path | None:
return self.remote.file
progspace = gdb.current_progspace()
assert progspace
fpath: str = progspace.filename
fpath: str = progspace.filename or ""
if fpath and not self._file:
self._file = pathlib.Path(fpath).expanduser()
return self._file
Expand Down Expand Up @@ -11548,7 +11550,7 @@ def file(self) -> pathlib.Path:
if not filename:
raise RuntimeError("No session started")
start_idx = len("target:") if filename.startswith("target:") else 0
self._file = pathlib.Path(progspace.filename[start_idx:])
self._file = pathlib.Path(filename[start_idx:])
return self._file

@property
Expand Down

0 comments on commit 8130895

Please sign in to comment.