You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Daniel Rall <dl...@finemaltcoding.com> on 2003/02/22 18:40:16 UTC

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

brane@tigris.org writes:

> Modified: trunk/subversion/tests/clients/cmdline/svntest/testcase.py
> ==============================================================================
> --- trunk/subversion/tests/clients/cmdline/svntest/testcase.py	(original)
> +++ trunk/subversion/tests/clients/cmdline/svntest/testcase.py	Fri Feb 21 22:06:20 2003
> @@ -71,6 +71,10 @@
>                                   self.pred.list_mode(),
>                                   self.pred.func.__doc__)
>  
> +  def _print_name(self):
> +    print os.path.basename(sys.argv[0]), \
> +          str(self.index) + ":", self.pred.func.__doc__
> +
>    def run(self, args):
>      if self.pred.cond:
>        error = 0
> @@ -84,16 +88,17 @@
>        except KeyboardInterrupt:
>          print "Interrupted"
>          sys.exit(0)
> -      except SystemExit:
> -        print "Got a SystemExit exception, exiting."
> -        sys.exit(0)
> +      except SystemExit, ex:
> +        print "Caught SystemExit(%d), skipping cleanup" % ex.code
> +        print ('PASS: ', 'FAIL: ')[ex.code != 0],
                                                   ^
> +        self._print_name()
> +        raise

What is the trailing comma for?  Seems harmless enough with print able
to deal with sequences (which aren't strings), but it's not clear to
me why it needs to be there.
-- 

Daniel Rall <dl...@finemaltcoding.com>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

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

Posted by "Edward S. Marshall" <es...@logic.net>.
On Sat, Feb 22, 2003 at 10:40:16AM -0800, Daniel Rall wrote:
> > +        print ('PASS: ', 'FAIL: ')[ex.code != 0],
> 
> What is the trailing comma for?  Seems harmless enough with print able
> to deal with sequences (which aren't strings), but it's not clear to
> me why it needs to be there.

"print" will add a trailing newline by default; adding a comma at the end
tells it not to. Odd syntax, but there you have it. :-)

-- 
Edward S. Marshall <es...@logic.net>
http://esm.logic.net/

Felix qui potuit rerum cognoscere causas.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org