Skip to content

fix: replace bare except with except Exception in ui_detect.py#500

Open
Kailigithub wants to merge 1 commit into
lsdefine:mainfrom
Kailigithub:fix/lint-ui-detect-e722
Open

fix: replace bare except with except Exception in ui_detect.py#500
Kailigithub wants to merge 1 commit into
lsdefine:mainfrom
Kailigithub:fix/lint-ui-detect-e722

Conversation

@Kailigithub
Copy link
Copy Markdown
Contributor

Summary

Replace bare except: with except Exception: in memory/ui_detect.py (line 108).

Changes

memory/ui_detect.py line 108: except:except Exception:

This bare except was catching ImageFont.truetype() failures when loading the Microsoft YaHei font, which would silently fall back to the default bitmap font. Using except Exception: prevents masking serious errors like KeyboardInterrupt and SystemExit.

Testing

  • python3 -m py_compile memory/ui_detect.py — passes
  • ruff check --select E722 memory/ui_detect.py — All checks passed

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