title: catching an IOError in python
body: <p>I wrote a method that does some stuff and catches bad filenames. what should happen is if the path doesn't exist, it throws an IOError. however, it thinks my exception handling is bad syntax... why??</p>
  
  <pre>
  def whatever():
      try:
          # do stuff
          # and more stuff
      except IOError:
          # do this
          pass
  whatever()
  </pre>
  
  <p>but before it even gets to calling <code>whatever()</code>, it prints the following:</p>
  
  <pre>
  Traceback (most recent call last):
    File "", line 1, in 
    File "getquizzed.py", line 55
      except IOError:
           ^
  SyntaxError: invalid syntax
  </pre>
  
  <p>when imported...help?!</p>