[BangPypers] Weird Try..Except Error

Nikunj.Badjatya at emc.com Nikunj.Badjatya at emc.com
Fri Nov 25 13:15:34 CET 2011


Also, I have not set any interpreter in the shebang line to use.

Anyways, 
Thanks All.

-----Original Message-----
From: bangpypers-bounces+nikunj.badjatya=emc.com at python.org [mailto:bangpypers-bounces+nikunj.badjatya=emc.com at python.org] On Behalf Of Noufal Ibrahim
Sent: Friday, November 25, 2011 5:24 PM
To: Bangalore Python Users Group - India
Subject: Re: [BangPypers] Weird Try..Except Error

<Nikunj.Badjatya at emc.com> writes:

[...]

> I checked the comma and spacing and didn't find any problem.

Python 3's "except" statement is different[1]

You should say 

        except ImportError as err_msg

Also, your error message is misleading. Best let the import error
propagate. The traceback will be more useful in fixing the problem than
the error message which you're printing. 

[...]

Footnotes: 
[1]  http://docs.python.org/release/3.1.3/tutorial/errors.html#handling-exceptions

-- 
~noufal
http://nibrahim.net.in

The first condition of immortality is death. -Stanislaw Lec
_______________________________________________
BangPypers mailing list
BangPypers at python.org
http://mail.python.org/mailman/listinfo/bangpypers



More information about the BangPypers mailing list