fix: replace 15 bare excepts with except Exception in REPL environments#124
Open
haosenwang1018 wants to merge 1 commit into
Open
fix: replace 15 bare excepts with except Exception in REPL environments#124haosenwang1018 wants to merge 1 commit into
haosenwang1018 wants to merge 1 commit into
Conversation
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)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Replace 15 bare
except:clauses withexcept Exception:across 5 REPL environment modules.Why
Bare
except:catchesKeyboardInterruptandSystemExit, 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/serializedocker_repl.py(3 sites): state load/save/serialize + exec error handlinge2b_repl.py(3 sites): state load/save/serializemodal_repl.py(3 sites): state load/save/serializeprime_repl.py(3 sites): state load/save/serializeAll 5 files follow the same pattern — the bare excepts guard against serialization failures (dill/repr), which should only raise standard exceptions.