One function
_get_bindings_for_with in bwhmather/ssort
The author described this change as “Fix support for with blocks”. It counts as a record because the check below fails on the code as it stood at df014e93f and passes on 31c5bf7a7, with nothing else changed between the two runs.
Projectbwhmather/ssort
Fix saved2021-04-06
Sharing licenceMIT · LICENSE
Change size+3 −0
What the code was meant to do, written into the code itself as a docstring
..code:: python With(withitem* items, stmt* body, string? type_comment) ..code:: python AsyncWith(withitem* items, stmt* body, string? type_comment)
The change
| 11 | 11 | for item in node.items: | |
| 12 | 12 | if item.optional_vars: | |
| 13 | 13 | yield from _flatten_target(item.optional_vars) | |
| 14 | + | ||
| 15 | + | for stmt in node.body: | |
| 16 | + | yield from get_bindings(stmt) |
The check that tells the two apart
fail→pass·tests/test_bindings.py::test_with_dependencies_bindings
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 itdf014e93f76a620bb8e8044718e9a4537e279b1d
Broken version dated2021-04-06
Modulessort._bindings
Units changed_get_bindings_for_with
Fingerprint43b86465c4c2a589
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_import
- 2021-03-29Fix dependencies being return for bindings in comprehensions