Commit 50e9a58
fix: Prevent get_battery from throwing "file not found"
Check if battery capacity and status files exist before attempting to read
them. This prevents errors on systems where the battery path exists but
the required files are missing.
Fixes dylanaraps#2129
(cherry-picked from dylanaraps#2130)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>1 parent 9ccb489 commit 50e9a58
1 file changed
Lines changed: 4 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1086 | 1086 | | |
1087 | 1087 | | |
1088 | 1088 | | |
1089 | | - | |
| 1089 | + | |
| 1090 | + | |
1090 | 1091 | | |
1091 | 1092 | | |
1092 | 1093 | | |
| |||
3678 | 3679 | | |
3679 | 3680 | | |
3680 | 3681 | | |
| 3682 | + | |
3681 | 3683 | | |
3682 | 3684 | | |
3683 | 3685 | | |
| |||
3823 | 3825 | | |
3824 | 3826 | | |
3825 | 3827 | | |
3826 | | - | |
3827 | | - | |
| 3828 | + | |
3828 | 3829 | | |
3829 | 3830 | | |
3830 | 3831 | | |
| |||
0 commit comments