Skip to content

修复:simphtml.py 中 4 处裸 except 子句#535

Open
Kailigithub wants to merge 1 commit into
lsdefine:mainfrom
Kailigithub:fix/simphtml-e722-bare-except
Open

修复:simphtml.py 中 4 处裸 except 子句#535
Kailigithub wants to merge 1 commit into
lsdefine:mainfrom
Kailigithub:fix/simphtml-e722-bare-except

Conversation

@Kailigithub
Copy link
Copy Markdown
Contributor

Summary

Replace 4 bare except: clauses with except Exception: in simphtml.py.

Bare except: catches all exceptions including SystemExit and KeyboardInterrupt, which should normally propagate. This is a standard Python best practice (PEP 8 / E722) fix.

Changes

  • simphtml.py:638start_temp_monitor: suppress js execution failure silently
  • simphtml.py:824execute_js: suppress get_html failure in no_monitor mode
  • simphtml.py:856get_temp_texts call: fallback to empty list on failure
  • simphtml.py:870 — DOM diff block: report unavailable on any error

Verification

  • Syntax check: python3 -m py_compile simphtml.py
  • Lint: ruff check simphtml.py --select E722 — All checks passed ✓

将 except: 替换为 except Exception:,避免捕获 SystemExit 和 KeyboardInterrupt 等系统异常。
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