Commit be8ab31
authored
Improve C ABI struct change error handling (#2386)
Over in #2369 I saw this C ABI change error
```
Traceback (most recent call last):
File "/opt/hostedtoolcache/Python/3.11.15/x64/bin/check-c-abi", line 6, in <module>
sys.exit(main_cli())
using dlpack from /home/runner/work/cuvs/cuvs/dlpack/include
^^^^^^^^^^
File "/opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages/check_c_abi/main.py", line 136, in main_cli
errors = analyze_c_abi(old_abi, new_abi)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages/check_c_abi/abi.py", line 351, in analyze_c_abi
errors.extend(_analyze_struct_abi(old_abi, new_abi))
File "/opt/hostedtoolcache/Python/3.11.15/x64/lib/python3.11/site-packages/check_c_abi/abi.py", line 293, in _analyze_struct_abi
new_struct.members,
^^^^^^^^^^
UnboundLocalError: cannot access local variable 'new_struct' where it is not associated with a value
```
This PR adds a `continue` so we avoid any unbounded variables.
Authors:
- James Bourbeau (https://github.com/jrbourbeau)
- Corey J. Nolet (https://github.com/cjnolet)
Approvers:
- Corey J. Nolet (https://github.com/cjnolet)
- Gil Forsyth (https://github.com/gforsyth)
URL: #23861 parent 90992ea commit be8ab31
2 files changed
Lines changed: 10 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| |||
287 | 287 | | |
288 | 288 | | |
289 | 289 | | |
| 290 | + | |
290 | 291 | | |
291 | 292 | | |
292 | 293 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| |||
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
68 | 75 | | |
69 | 76 | | |
70 | 77 | | |
| |||
0 commit comments