title: try ... except ... as error in Python 2.5 - Python 3.x
body: <p>I want to keep &amp; use the error value of an exception in both Python 2.5, 2.7 and 3.2.</p>
  
  <p>In Python 2.5 and 2.7 (but not 3.x), this works:</p>
  
  <pre><code>try:
      print(10 * (1/0))
  except ZeroDivisionError,  error:       # old skool
      print("Yep, error caught:", error)
  </code></pre>
  
  <p>In Python 2.7 and 3.2 (but not in 2.5), this works:</p>
  
  <pre><code>try:
      print(10 * (1/0))
  except (ZeroDivisionError) as error:    # 'as' is needed by Python 3
      print("Yep, error caught:", error)
  </code></pre>
  
  <p>Is there any code for this purpose that works in both 2.5, 2.7 and 3.2?</p>
  
  <p>Thanks</p>