Conversation
Bare `except:` blocks silently swallow KeyboardInterrupt/SystemExit along with real errors, making the process hard to interrupt and hiding bugs. Switch all 35 occurrences to `except Exception:`, which preserves existing behavior for actual sensor errors. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FyR2qGEWt3ApGumu5ykE5X
Same rationale as sensors_python.py: bare except: silently swallows KeyboardInterrupt/SystemExit along with real errors. Switch all 24 occurrences to except Exception:, preserving existing behavior. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FyR2qGEWt3ApGumu5ykE5X
Same rationale as sensors_python.py/configure.py: bare except: silently swallows KeyboardInterrupt/SystemExit along with real errors. Switch to except Exception:, preserving existing behavior. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FyR2qGEWt3ApGumu5ykE5X
Same rationale as sensors_python.py/configure.py: bare except: silently swallows KeyboardInterrupt/SystemExit along with real errors. Switch to except Exception:, preserving existing behavior. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FyR2qGEWt3ApGumu5ykE5X
Same rationale as sensors_python.py/configure.py: bare except: silently swallows KeyboardInterrupt/SystemExit along with real errors. Switch to except Exception:, preserving existing behavior. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FyR2qGEWt3ApGumu5ykE5X
Same rationale as sensors_python.py/configure.py: bare except: silently swallows KeyboardInterrupt/SystemExit along with real errors. Switch to except Exception:, preserving existing behavior. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FyR2qGEWt3ApGumu5ykE5X
Same rationale as sensors_python.py/configure.py: bare except: silently swallows KeyboardInterrupt/SystemExit along with real errors. Switch to except Exception:, preserving existing behavior. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FyR2qGEWt3ApGumu5ykE5X
Same rationale as sensors_python.py/configure.py: bare except: silently swallows KeyboardInterrupt/SystemExit along with real errors. Switch to except Exception:, preserving existing behavior. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FyR2qGEWt3ApGumu5ykE5X
Same rationale as sensors_python.py/configure.py: bare except: silently swallows KeyboardInterrupt/SystemExit along with real errors. Switch to except Exception:, preserving existing behavior. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FyR2qGEWt3ApGumu5ykE5X
…or.py Same rationale as sensors_python.py/configure.py: bare except: silently swallows KeyboardInterrupt/SystemExit along with real errors. Switch to except Exception:, preserving existing behavior. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FyR2qGEWt3ApGumu5ykE5X
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
except:clauses silently swallowKeyboardInterrupt/SystemExit/GeneratorExitalong with real errors, which can make the process hard to interrupt and hides bugs that should surface.except:withexcept Exception:(95 occurrences acrosssensors_python.py,configure.py,theme-editor.py,library/stats.py,main.py,library/config.py,library/lcd/lcd_comm.py,library/lcd/lcd_comm_rev_c.py,library/pythoncheck.py,library/sensors/sensors_librehardwaremonitor.py), one commit per file for easy review.except Exception:still catches everything these blocks were built to handle.Test plan
python -m pytest tests/— same pass/fail counts asmain(no regressions introduced by this change)python -m py_compileon every touched fileflake8 --select=E9,F63,F7,F82on every touched file — no hard errors🤖 Generated with Claude Code
https://claude.ai/code/session_01FyR2qGEWt3ApGumu5ykE5X