Re: [Pyunit-interest] exception and except:
Brought to you by:
purcell
From: robin a. j. <rob...@ea...> - 2003-03-05 00:21:47
|
exception and except: ----- Original Message -----=20 From: Srikanth Mandava=20 To: pyu...@li...=20 Sent: Tuesday, March 04, 2003 04:12 PM Subject: [Pyunit-interest] exception and except: Hi,=20 What is the different between catching "Exception" and a "except :":=20 In this particular example, I do not think there is much of a = difference -- other than in the first case, you can directly investigate = the error message via the 'e' parameter. A more typical example might involve more specific categories of = exceptions like: try: <something> except (IOError, TypeError), details: <handle these types of exceptions> except NotImplementedError, details: <handle this type of exception> except Exception, details: <handle all remaining types of exceptions> else: <continue normal processing> try :=20 except (Exception), e:=20 pass=20 and=20 try:=20 except :=20 pass=20 Thanks=20 Srikanth=20 |