On Thu, 05 Apr 2007, Hyrum K. Wright wrote:
> Daniel Rall wrote:
> > On Thu, 05 Apr 2007, Malcolm Rowe wrote:
> >
> >> On Thu, Apr 05, 2007 at 11:06:24AM +0200, Michael Haggerty wrote:
> >>> hwright@tigris.org wrote:
> >>>> Author: hwright
> >>>> Date: Tue Apr 3 10:00:26 2007
> >>>> New Revision: 24383
> >>>>
> >>>> Log:
> >>>> In the test suite, use Python boolean values instead of integers masquerading
> >>>> as booleans.
> >>>>
> >>>> * subversion/test/cmdline/svntest/main.py:
> >>>> (windows, platform_with_os_wait, verbose_mode, cleanup_mode, enable_sasl):
> >>>> Use True and False, instead of 1 and 0.
> >>>>
> >>>>
> >>>> Modified:
> >>>> trunk/subversion/tests/cmdline/svntest/main.py
> >>>> [...]
> >>> What version of Python is required for the test suite?
> >>>
> >> 2.0, so you're right, we need to fix this.
> >>
> >> I thought we already had our own custom True and False, but I can't find
> >> them now, so I guess not.
> >
> > Yup, 2.0 -- I wondered the same thing when I saw this commit go by,
> > but didn't know in what version of Python True and False were
> > introduced.
> >
> > I'd be in favor of the test suite defining True and False if they're
> > not already defined.
>
> I didn't realize that True and False haven't been defined since 2.0. I
> would also be in favor of defining them. Would the following work:
>
> try:
> False
> except:
> False = 0
> True = 1
Yup, that should work -- the initial reference to False should work in
2.2+, and fail with a NameError when not recognized.
- application/pgp-signature attachment: stored
Received on Thu Apr 5 19:45:35 2007