Skip to content

fix: replace bare except clauses with except Exception across codebase#562

Closed
Kailigithub wants to merge 1 commit into
lsdefine:mainfrom
Kailigithub:optimize/replace-bare-except
Closed

fix: replace bare except clauses with except Exception across codebase#562
Kailigithub wants to merge 1 commit into
lsdefine:mainfrom
Kailigithub:optimize/replace-bare-except

Conversation

@Kailigithub
Copy link
Copy Markdown
Contributor

Summary

Replaces all 46 bare except: clauses with except Exception: across 15 files.

Bare except: catches all exceptions including KeyboardInterrupt and SystemExit, silently swallowing critical signals that should propagate. Using except Exception: is the standard Python best practice — it catches runtime errors while allowing system-level exceptions to pass through.

Files Changed

File Count
llmcore.py 17
ga.py 8
simphtml.py 4
agentmain.py 3
frontends/qtapp.py 2
frontends/stapp.py 2
frontends/stapp2.py 2
assets/code_run_header.py 1
frontends/tgapp.py 1
frontends/wechatapp.py 1
memory/autonomous_operation_sop/helper.py 1
memory/ljqCtrl.py 1
memory/ui_detect.py 1
plugins/langfuse_tracing.py 1
reflect/scheduler.py 1

Verification

  • All 15 modified files pass py_compile syntax check
  • ruff check --select E722 reports 0 remaining bare except clauses
  • Change is mechanical (except:except Exception:), no logic altered

@lsdefine lsdefine closed this Jun 4, 2026
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.

2 participants