One function
_get_bindings_for_import in bwhmather/ssort
The author described this change as “Fix binding only root module in nested imports”. It counts as a record because the check below fails on the code as it stood at 31c5bf7a7 and passes on a0acd5cdc, with nothing else changed between the two runs.
Projectbwhmather/ssort
Fix saved2021-04-06
Sharing licenceMIT · LICENSE
Change size+5 −1
What the code was meant to do, written into the code itself as a docstring
..code:: python Import(alias* names)
The change
| 5 | 5 | Import(alias* names) | |
| 6 | 6 | """ | |
| 7 | 7 | for name in node.names: | |
| 8 | - | yield name.asname if name.asname else name.name | |
| 8 | + | if name.asname: | |
| 9 | + | yield name.asname | |
| 10 | + | else: | |
| 11 | + | root, *rest = name.name.split(".", 1) | |
| 12 | + | yield root |
The check that tells the two apart
fail→pass·tests/test_bindings.py::test_import_bindings_nested
Check file tests/test_bindings.py, taken without changes from the fix and copied onto the older code, so the exact same check runs against both versions.
Origin and history
The code before it31c5bf7a702d23ec3e938816614d054ef22dbfcf
Broken version dated2021-04-06
Modulessort._bindings
Units changed_get_bindings_for_import
Fingerprint10f96b2e0b9125ff
Checked2026-08-18 by goldset/0.1
Every field above is generated by our program. None of it is written by hand.
Other bugs found in bwhmather/ssort
- 2026-08-03Fix handling of nested classes
- 2024-01-18Fix detection of self argument name when positional-only
- 2022-07-22Fix lambda requirements with walrus operator
- 2021-08-08_get_bindings_for_named_expr
- 2021-04-06_get_bindings_for_with
- 2021-03-29Fix dependencies being return for bindings in comprehensions