Re: [python] using try: finally: except

From: Miki Tebeka (miki.tebeka_at_zoran.com)
Date: 06/20/04


Date: Sun, 20 Jun 2004 10:29:17 +0200
To: David Stockwell <winexpert@hotmail.com>

Hello David,

> In referring to my copy of the python bible, it tells me I can't use all
> three items 'try' except and finally. I can use the t/f or t/e
> combinations though
>
> What combination can i use if i want to catch the exception and still have
> a finally block?
try:
    try:
        do_something()
    except Exception, e:
        print "bummer"
finally:
    print "at last"

Google this list for why you can't have try/except/finally together.

HTH.

--
-------------------------------------------------------------------------
Miki Tebeka <miki.tebeka@zoran.com>
The only difference between children and adults is the price of the toys.


Relevant Pages

  • Re: Survey for Regular Posters AND LURKERS...
    ... exception to painting the purchase of concert tickets, ... price, as something a family trying to stay afloat would even be ... exception" to anyone who writes fast and on the fly. ... seats and kids free - but the fact is, ...
    (rec.music.artists.springsteen)
  • Re: more closed-world chatter
    ... Since 3 is not in the domain of item prices, I would expect a type mismatch ... What is the difference between 'select from items where Price = ... the logical complement of "Items" has four tuples - loosely, ... relation or should it take exception, ...
    (comp.databases.theory)
  • Re: Dr. Who/V for Vandetta
    ... and Texas that _flew_in_ and drove their new car home. ... So a dealership that was unusual enough that people flew in from ... significant numbers of states away isn't an exception to the rule? ... the actual price, not the way in which it was reached. ...
    (rec.arts.sf.fandom)
  • Re: XML and Direct Pathing to a node
    ... The full exception information please. ... Dim _doc As New XmlDocument ... <bestAvailableToBackPrices> ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Price Check: Omega Race
    ... deal is the exception to the rule. ... You don't often find a four cabinet ... need/want for an "okay" price, let alone a really good one. ... the fact that Omega Race seems to be such a pain to ...
    (rec.games.video.arcade.collecting)