[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

RE: Re: Bug: log-police.py and python 3.0rc1

From: Gleason, Todd <tgleason_at_impac.com>
Date: Thu, 2 Oct 2008 07:21:05 -0700

Can't you just check sys.version_info and only set True/False if
sys.Version_info[:2] < (2, 3) ?

> -----Original Message-----
> From: news [mailto:news_at_ger.gmane.org] On Behalf Of Dave Lawrence
> Sent: Thursday, October 02, 2008 6:48 AM
> To: users_at_subversion.tigris.org
> Cc: SubVersion Users
> Subject: Re: Bug: log-police.py and python 3.0rc1
>
> Ryan Schmidt wrote:
> > With python 3.0rc1, the log-police.py script says this:
> >
> >
> > File
"/opt/local/share/subversion/tools/hook-scripts/log-police.py",
> > line 24
> > True = 1
> > SyntaxError: assignment to keyword
> >
> >
> > It works fine with python 2.5.2.
>
> Infact in python 2.5 you can say True = 0 !
>
> This code is trying to maintain compatability with python pre 2.3
which
> didn't have True and False. There must be loads of code out there
that
> does this, it will all be broken because the syntax check happens
> regardless of whether the except clause is actually invoked.
>
> Maybe the Python guys can offer a solution to what surely is about to
> become a common problem.
>
> If not, I offer two: either:
> 1) Define our own true and false (as True and False if available or as
0
> and 1 if not). log-police.patch attached
>
> or
> 2) Don't try and assign to True and False at all, this will break
> compatibility with python pre 2.3. log-police2.patch attached.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_subversion.tigris.org
For additional commands, e-mail: users-help_at_subversion.tigris.org
Received on 2008-10-02 16:23:58 CEST

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.