Skip to content

Commit

Permalink
Fix Linux AssertionError
Browse files Browse the repository at this point in the history
  • Loading branch information
Vinyzu committed Apr 18, 2024
1 parent e9717c7 commit 708f40f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions cdp_patches/input/os_base/linux.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,8 @@ def search_windows_by_pid(query_tree, pid: int):
search_windows_by_pid(window.query_tree(), pid)

search_windows_by_pid(self.display.screen().root.query_tree(), self.pid)
assert res_windows, WindowClosedException(f"No windows found for PID: {self.pid}")
if not res_windows:
raise WindowClosedException(f"No windows found for PID: {self.pid}")

for window in res_windows:
# Getting necessary window properties
Expand Down Expand Up @@ -158,7 +159,8 @@ def search_windows_by_pid(query_tree, pid: int):
search_windows_by_pid(window.query_tree(), pid)

await self._loop.run_in_executor(None, lambda: search_windows_by_pid(self.display.screen().root.query_tree(), self.pid))
assert res_windows, WindowClosedException(f"No windows found for PID: {self.pid}")
if not res_windows:
raise WindowClosedException(f"No windows found for PID: {self.pid}")

for window in res_windows:
# Getting necessary window properties
Expand Down

0 comments on commit 708f40f

Please sign in to comment.