fix(handler): replace raise e with bare raise and use is None#135
Open
Jah-yee wants to merge 1 commit into
Open
fix(handler): replace raise e with bare raise and use is None#135Jah-yee wants to merge 1 commit into
Jah-yee wants to merge 1 commit into
Conversation
- Replace 'raise e' with bare 'raise' in getBatchDetailsIter to preserve the original exception traceback instead of creating a new exception - Replace 'batch_size == None' with 'batch_size is None' in getBatchDetails for PEP 8 style consistency (getBatchDetailsIter already uses 'is None')
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
Fixes an exception chaining anti-pattern in
Handler.getBatchDetailsIterthat was masking original tracebacks, and applies PEP 8 style consistency ingetBatchDetails.Changes
Replace
raise ewith bareraise(line 395)raise ecreates a new exception without preserving the original traceback,making debugging significantly harder. Bare
raisere-raises the activeexception while keeping the full chain intact.
Use
is Noneinstead of== NoneingetBatchDetails(line 235)PEP 8 style consistency — the sibling method
getBatchDetailsIteralreadyuses
is None.Impact
Verification
python3 -m py_compile ipinfo/handler.py # passes