You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Greg Stein <gs...@lyra.org> on 2001/11/06 21:05:53 UTC

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

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