Skip to content

fix: narrow window title exception handling - #141

Open
RoboX2020 wants to merge 2 commits into
petercorke:mainfrom
RoboX2020:fix/window-title-exceptions
Open

RoboX2020 wants to merge 2 commits into
petercorke:mainfrom
RoboX2020:fix/window-title-exceptions

Conversation

@RoboX2020

Copy link
Copy Markdown

Addresses the set_window_title part of #115.

Catch AttributeError and RuntimeError for backends without a usable window manager instead of swallowing every exception. Unexpected ValueError failures and KeyboardInterrupt now propagate.

Five headless tests cover normal title forwarding, the two tolerated backend failures, and the two propagated errors. The latter two fail on the original implementation.

Validation on Python 3.11:

  • New tests: 5 passed on OpenCV 4.12.0.88 and 5.0.0.93.
  • Full OpenCV 5 suite: 964 passed, 97 skipped, 5 subtests passed.
  • Both changed files pass black; new tests pass ruff.

Tests use a minimal window-manager adapter; no actual desktop GUI was opened. The full suite was not run on OpenCV 4. Other exception sites in #115 remain separate.

@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 0 complexity · 0 duplication

Metric Results
Complexity 0
Duplication 0

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant