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

Re: [PATCH] change-svn-wc-format.py

From: Edmund Wong <edmund_at_belfordhk.com>
Date: Tue, 31 Mar 2009 11:55:17 +0800

Edmund Wong wrote:
>
> Btw, someone on the users list is asking for a Python 3.0
> version of this script because it's err'ing on line 92,
> which is :
>
> except UnrecognizedWCFormatException, e:
>
> It's scary how coincidental this is considering I only
> just finished patching this script.
>

I was reading the changes at python.org and came across
this tidbit:

One error that Python programmers occasionally make is writing the
following code:

try:
     ...
except TypeError, ValueError: # Wrong!
     ...

The author is probably trying to catch both TypeError and ValueError
exceptions, but this code actually does something different: it will
catch TypeError and bind the resulting exception object to the local
name "ValueError". The ValueError exception will not be caught at all.
The correct code specifies a tuple of exceptions:

try:
     ...
except (TypeError, ValueError):

Does this mean I'll need to go through the latest revision of
change-svn-wc-format.py and modify these exception catching
lines?

Edmund

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=1490766
Received on 2009-03-31 12:57:52 CEST

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