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

Re: svn commit: rev 408 - trunk/subversion/tests/clients/cmdline trunk/subversion/tests/clients/cmdline/svntest

From: Greg Stein <gstein_at_lyra.org>
Date: 2001-11-06 22:05:53 CET

On Tue, Nov 06, 2001 at 02:05:34PM -0600, kfogel@tigris.org wrote:
> Author: kfogel
> Date: 2001-11-06 20:05 GMT
> New Revision: 408
>
> Modified:
> trunk/subversion/tests/clients/cmdline/log_tests.py
> trunk/subversion/tests/clients/cmdline/svntest/main.py
> trunk/subversion/tests/clients/cmdline/svntest/tree.py
> Log:
> * tree.py (SVNTreeError, SVNTreeUnequal, SVNTypeMismatch,
> SVNTreeIsNotDirectory): Moved these exception class declarations from
> here...

And what would be easier is to move them svntest/__init__.py. You could then
lose the SVN prefix on all of those since you'd have:

    except svntest.TreeError:

You could also put them into svntest/errors.py, use "from svntest import
errors" and then refer to them as errors.TreeError.

Next, create a single superclass for all of them:

class TestException(Exception):
  pass

clas SVNTreeError(TestException):
  pass

That would allow:

    except svntest.TestException:
    
to catch all the errors, rather than needing to do something like:

    except (svntest.TreeError, svtest.TreeUnequal, ...):

or use multiple except clauses.

Cheers,
-g

-- 
Greg Stein, http://www.lyra.org/
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sat Oct 21 14:36:48 2006

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

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