title: NameError, global not defined when using try,except
body: <p>Edit:<br>
  Ignore this, I figured it out about 3 seconds after posting this but can't delete it =(</p>
  
  <p>I have this try, except code for working with RackSpace cloudfiles</p>
  
  <pre><code>    try:
          cacheobject = cachecontainer.get_object('file.jpg')
      except NoSuchObject as objectname:
          raise tornado.web.HTTPError(404)
  </code></pre>
  
  <p>If 'file.jpg' is not found, the exception 'NoSuchObject' is raised. When I run this code I get the error</p>
  
  <blockquote>
    <p>except NoSuchObject as objectname:<br>
    NameError: global name 'NoSuchObject' is not defined</p>
  </blockquote>
  
  <p>I tried putting NoSuchObject in quotes but then I got an error about string exceptions being depreciated.</p>