[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 248 - trunk/subversion/tests/clients/cmdline/svntest

From: Ben Collins-Sussman <sussman_at_collab.net>
Date: 2001-10-17 15:25:19 CEST

Greg Stein <gstein@lyra.org> writes:

> I don't know the code here, but I'd recommend thinking things through a
> *few* times if you ever find yourself using "except:"

Well, here's the scenario.

The main python routine loops over a list of tests, and runs each one.
It does this by repeatedly calling a subroutine that executes exactly
one test (a particular test number). This subroutine's job is to
return a 1 or 0 to the main routine, indicating whether the test
passed or failed. In the end, the main python routine remembers
whether any tests failed.

The problem is that we've defined particular kinds of execptions --
SVNTreeUnequal, and others. Sometimes our code explicitly raises
them. When this happens, python bombs out completely. We'd rather
just have the test return an error code instead, so the next tests
will run.

So... should we simply be looking to trap a list of *particular*
exceptions? Like all those that our code might be expected tot throw?
And also, is there a way to catch an exception and *still* print the
traceback before returning an error value?

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:44 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.