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.

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

480480 overlapped = options + [o for o in argv if type(o) is Option]
481481 extras(help, version, overlapped, doc)
482482 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:
484484 formal_pattern = GreedyEither(*formal_pattern.children[0].children)
485485 pot_arguments = [a for a in formal_pattern.flat if type(a) is Argument]
486486 matched, left, collected = formal_pattern.fix().match(argv)

The check that tells the two apart

failpass·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.

Other bugs found in jazzband/docopt-ng