[BangPypers] Weird Try..Except Error
Noufal Ibrahim
noufal at gmail.com
Fri Nov 25 12:53:41 CET 2011
<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
More information about the BangPypers
mailing list