mirror of
https://github.com/X11Libre/xserver.git
synced 2026-10-30 02:39:59 +00:00
test/pyxtest: catch OSError when closing Xlib display
Avoid a blind Exception catch around display.close() (ruff BLE001/S110). Assisted-by: AI Signed-off-by: Olivier Fourdan <ofourdan@redhat.com> Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2265>
This commit is contained in:
parent
6660a0f66b
commit
28a7f67f56
1 changed files with 2 additions and 1 deletions
|
|
@ -574,7 +574,8 @@ class XlibConnection:
|
|||
def close(self):
|
||||
try:
|
||||
self.display.close()
|
||||
except Exception:
|
||||
except OSError:
|
||||
# Display may already be closed (e.g. server gone).
|
||||
pass
|
||||
|
||||
def __enter__(self) -> Self:
|
||||
|
|
|
|||
Loading…
Reference in a new issue