Repository navigation
Commit f6a3db0
authored
Fix #15215 (misra.py: analyse_ctu_info() does not close the ctu-info files) (#9025)
`analyse_ctu_info()` does not close the ctu-info files. This gives a
`ResourceWarning` in Python dev mode.
```
PYTHONDEVMODE=1 cppcheck -q --addon=misra addons/test/misra/misra-ctu-1-test.c addons/test/misra/misra-ctu-2-test.c
```
Before PR:
```
:0:0: error: Bailing out from analysis: Whole program analysis failed: Failed to execute 'python3.exe ...\addons\runaddon.py ...\addons\misra.py --cli 22364.ctu-info'. ...\addons\misra.py:4917: ResourceWarning: unclosed file <_io.TextIOWrapper name='22364.ctu-info' mode='rt' encoding='utf-8'> [internalError]
```
After PR: no output.1 parent a05fbed commit f6a3db0
1 file changed
Lines changed: 5 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4912 | 4912 | | |
4913 | 4913 | | |
4914 | 4914 | | |
| 4915 | + | |
| 4916 | + | |
| 4917 | + | |
| 4918 | + | |
4915 | 4919 | | |
4916 | 4920 | | |
4917 | | - | |
| 4921 | + | |
4918 | 4922 | | |
4919 | 4923 | | |
4920 | 4924 | | |
| |||
0 commit comments