Skip to content

fix: replace 15 bare excepts with except Exception in REPL environments#124

Open
haosenwang1018 wants to merge 1 commit into
alexzhang13:mainfrom
haosenwang1018:fix/bare-excepts
Open

fix: replace 15 bare excepts with except Exception in REPL environments#124
haosenwang1018 wants to merge 1 commit into
alexzhang13:mainfrom
haosenwang1018:fix/bare-excepts

Conversation

@haosenwang1018
Copy link
Copy Markdown

Summary

Replace 15 bare except: clauses with except Exception: across 5 REPL environment modules.

Why

Bare except: catches KeyboardInterrupt and SystemExit, which can mask real errors and prevent clean process termination. except Exception: preserves the intended error-suppression behavior (state serialization, repr fallback, etc.) while allowing system-level exceptions to propagate normally.

Changes

All changes are in rlm/environments/ — no core files touched:

  • daytona_repl.py (3 sites): state load/save/serialize
  • docker_repl.py (3 sites): state load/save/serialize + exec error handling
  • e2b_repl.py (3 sites): state load/save/serialize
  • modal_repl.py (3 sites): state load/save/serialize
  • prime_repl.py (3 sites): state load/save/serialize

All 5 files follow the same pattern — the bare excepts guard against serialization failures (dill/repr), which should only raise standard exceptions.

Bare `except:` catches KeyboardInterrupt and SystemExit, which can mask
real errors and prevent clean process termination. Replace with
`except Exception:` to preserve error-suppression behavior while
allowing system-level exceptions to propagate.

Files changed (5 REPL environment modules):
- daytona_repl.py (3 sites)
- docker_repl.py (3 sites)
- e2b_repl.py (3 sites)
- modal_repl.py (3 sites)
- prime_repl.py (3 sites)
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