Commit 7bc8788
committed
fix(pip): handle None entries in AST list fields
Python's AST represents dict unpacking with None in Dict.keys. The
existing code assumed that list fields only contain AST nodes and would
therefore crash when encountering None.
Seen in the wild with lxml:
https://github.com/lxml/lxml/blob/283d02ec8966c0e99f4666dc7bdd936479e97246/setup.py#L98
Signed-off-by: Taylor Madore <tmadore@redhat.com>1 parent 66290de commit 7bc8788
2 files changed
Lines changed: 19 additions & 1 deletion
File tree
- hermeto/core/package_managers/pip
- tests/unit/package_managers/pip
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
585 | 585 | | |
586 | 586 | | |
587 | 587 | | |
588 | | - | |
| 588 | + | |
| 589 | + | |
589 | 590 | | |
590 | 591 | | |
| 592 | + | |
| 593 | + | |
591 | 594 | | |
592 | 595 | | |
593 | 596 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1013 | 1013 | | |
1014 | 1014 | | |
1015 | 1015 | | |
| 1016 | + | |
| 1017 | + | |
| 1018 | + | |
| 1019 | + | |
| 1020 | + | |
| 1021 | + | |
| 1022 | + | |
| 1023 | + | |
| 1024 | + | |
| 1025 | + | |
| 1026 | + | |
| 1027 | + | |
| 1028 | + | |
| 1029 | + | |
| 1030 | + | |
1016 | 1031 | | |
1017 | 1032 | | |
1018 | 1033 | | |
| |||
0 commit comments