2

Possible Duplicate:
Python try…except comma vs 'as' in except

This question is so basic that I'm embarrassed to ask it. However I've had trouble finding the answer online or in my python book and I hope I've worded and tagged this question well so that other people might benefit from the answers.

In python, a try-catch block looks like this:

try:
   do_Some_Stuff()
except ExceptionType as e:
   # Handle the error

I ran accross some code that seems to have a comma instead of the 'as'. Is this the same thing?

try:
   do_Some_Stuff()
except ExceptionType, e:  # <-- comma(',') instead of 'as' here
   # Handle the error

Thanks in advance for not making me feel too stupid!

Community
  • 1
  • 1
Chris Dutrow
  • 48,402
  • 65
  • 188
  • 258

0 Answers0