[issue15302] Use argparse instead of getopt in test.regrtest

Chris Jerdonek report at bugs.python.org
Thu Dec 27 21:09:13 CET 2012


Chris Jerdonek added the comment:

Rietveld is erroring out on me again whenever I try to reply to a comment, so I'm posting my comment here.

On 2012/12/27 18:29:22, Benjamin Peterson wrote:
> > On 2012/12/27 04:44:33, Benjamin Peterson wrote:
> > > if val:
> > 
> > Again, we need this to match getopt behavior. Using "if val" would replace
> the
> > value provided for all options accepting a value with the empty string. In
> > particular, the test_fromfile() test case (and two others) would fail with
> that
> > change. On the flip side, getopt causes provided boolean options to show up
> as
> > having an empty string value in the return value which is why I'm setting val
> to
> > ''.
> 
> I suppose this stuff is temporary anyway until regrtest can actualy use a nice
> namespace.

Right. That part is a temporary bridge.

I updated the patch based on your original comments, by the way. The patch is a lot simpler now, including dropping the need to subclass ArgumentParser, taking out the old usage() function, simplifying the tests, and making the need for the tests more explicit (which also can be removed after switching to using a namespace object).

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue15302>
_______________________________________


More information about the Python-bugs-list mailing list