2) Navigating with the keyboard sometimes raised exceptions (because I
was checking if an invalid item was enabled (!)). BTW, if raising a
string error is now deprecated in Python 2.5, what am I supposed to
raise if I catch an exception and I want to display a custom error
message? Surely the BDFL had a good reason (!) to remove this option.
String exceptions were allowed originally because user-defined classes
didn't exist at the time. String exceptions were a backwards
compatability allowance that should have died one release after custom
classes were allowed (pre 2.x).
If you want to raise a custom exception...
class myException(Exception): pass
...
try:
... raise myException(1,2,3)
... except myException, args:
... print args
...
(1, 2, 3)
- Josiah
ยทยทยท
"Andrea Gavana" <andrea.gavana@gmail.com> wrote: