Whole file
jazzband/docopt-ng
The author described this change as “fix parsing of empty pattern”. It counts as a record because the check below fails on the code as it stood at 01b6547f7 and passes on 27e8879bc, with nothing else changed between the two runs.
Projectjazzband/docopt-ng
Fix saved2012-06-01
Sharing licenceMIT · LICENSE-MIT
Change size+1 −1
What the code was meant to do, written into the code itself as a save note
fix parsing of empty pattern
The change
| 480 | 480 | overlapped = options + [o for o in argv if type(o) is Option] | |
| 481 | 481 | extras(help, version, overlapped, doc) | |
| 482 | 482 | formal_pattern = pattern(formal_usage(DocoptExit.usage), options=options) | |
| 483 | - | if type(formal_pattern.children[0]) is Either: | |
| 483 | + | if formal_pattern.children and type(formal_pattern.children[0]) is Either: | |
| 484 | 484 | formal_pattern = GreedyEither(*formal_pattern.children[0].children) | |
| 485 | 485 | pot_arguments = [a for a in formal_pattern.flat if type(a) is Argument] | |
| 486 | 486 | matched, left, collected = formal_pattern.fix().match(argv) |
The check that tells the two apart
fail→pass·test_docopt.py::test_empty_pattern
Check file test_docopt.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 it01b6547f7206e7d319b8395328b8dda76651b562
Broken version dated2012-06-01
Moduledocopt
Units changeddocopt
Fingerprint9fd52eed6f4d01fa
Checked2026-08-18 by goldset/0.1
Every field above is generated by our program. None of it is written by hand.