Mercurial > hg
comparison mercurial/dispatch.py @ 34131:0fa781320203
doctest: bulk-replace string literals with b'' for Python 3
Our code transformer can't rewrite string literals in docstrings, and I
don't want to make the transformer more complex.
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Sun, 03 Sep 2017 14:32:11 +0900 |
parents | 5361771f9714 |
children | 0e48813cc106 |
comparison
equal
deleted
inserted
replaced
34130:ada8a19672ab | 34131:0fa781320203 |
---|---|
605 """Return list of values for an option (or aliases). | 605 """Return list of values for an option (or aliases). |
606 | 606 |
607 The values are listed in the order they appear in args. | 607 The values are listed in the order they appear in args. |
608 The options and values are removed from args. | 608 The options and values are removed from args. |
609 | 609 |
610 >>> args = ['x', '--cwd', 'foo', 'y'] | 610 >>> args = [b'x', b'--cwd', b'foo', b'y'] |
611 >>> _earlygetopt(['--cwd'], args), args | 611 >>> _earlygetopt([b'--cwd'], args), args |
612 (['foo'], ['x', 'y']) | 612 (['foo'], ['x', 'y']) |
613 | 613 |
614 >>> args = ['x', '--cwd=bar', 'y'] | 614 >>> args = [b'x', b'--cwd=bar', b'y'] |
615 >>> _earlygetopt(['--cwd'], args), args | 615 >>> _earlygetopt([b'--cwd'], args), args |
616 (['bar'], ['x', 'y']) | 616 (['bar'], ['x', 'y']) |
617 | 617 |
618 >>> args = ['x', '-R', 'foo', 'y'] | 618 >>> args = [b'x', b'-R', b'foo', b'y'] |
619 >>> _earlygetopt(['-R'], args), args | 619 >>> _earlygetopt([b'-R'], args), args |
620 (['foo'], ['x', 'y']) | 620 (['foo'], ['x', 'y']) |
621 | 621 |
622 >>> args = ['x', '-Rbar', 'y'] | 622 >>> args = [b'x', b'-Rbar', b'y'] |
623 >>> _earlygetopt(['-R'], args), args | 623 >>> _earlygetopt([b'-R'], args), args |
624 (['bar'], ['x', 'y']) | 624 (['bar'], ['x', 'y']) |
625 """ | 625 """ |
626 try: | 626 try: |
627 argcount = args.index("--") | 627 argcount = args.index("--") |
628 except ValueError: | 628 except ValueError: |