Re: Exception handling....dumb question?

2006-04-02 Thread Flexx
Ben Finney writes:
 > You should catch *specific* exceptions that you know you can deal with at 
 > that point in the code.
 >
 > import logging
 > try:
 > foo = 12 / 0
 > except ZeroDivisionError, e:
 > print "You *knew* this was going to happen: '%s'" % e
 > logging.error(str(e))
 >
 > This allows all other exceptions to propogate back through the call
 > stack.

import sys, logging
try:
 foo = 12/0
except:
 e = str(sys.exc_value)
 print "You *knew* this was going to happen: '%s'" % (e)
 logging.error(e)
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Python 2.5 licensing: stop this change

2006-04-10 Thread Flexx
Steve Holden

>>  It was an April Fool's joke. It's not actually true.
>>
> To try and ensure this thread dies for ever, I have added a note to the 
> blog entry at
> 
>   http://pyfound.blogspot.com/2006/04/python-25-licensing-change.html
> 
> noting the fact that this was indeed an April Fool's joke.

"Python Software Foundation News: Python 2.5 Licensing Change
Saturday, April 01, 2006
Python 2.5 Licensing Change"

Look at the date =)
-- 
http://mail.python.org/mailman/listinfo/python-list