title: What's an elegant way to catch the same exception multiple times?
body: <p>I have some Python code that tries a bunch of different database queries before it concludes that the database is empty and gives up. Here is a simplified example:</p>
  
  <pre><code>try:
      result = Object.get(name="requested_object")
  except Object.DoesNotExist:
      try:
          result = Object.get(name="default_object")
      except Object.DoesNotExist:
          try:
              result = Object.get(pk=1)
          except Object.DoesNotExist:
              print "The database is empty!"
              raise
  </code></pre>
  
  <p>Note that the exception I'm trying to catch is the same every time. Surely there must be a way to do this without needless repetition and nesting. How can I achieve the same behavior without the nested try...except statements?</p>