What is the difference between 'except IOError as e:' and 'except IOError, e:'

Peng Yu pengyu.ut at gmail.com
Tue Nov 17 21:28:16 EST 2009


I don't see any different between the following code in terms of
output. Are they exactly the same ('as' v.s. ',')?

try:
  raise IOError('IOError')
except IOError as e:
  print e

try:
  raise IOError('IOError')
except IOError, e:
  print e



More information about the Python-list mailing list