title: python2 vs. python3 raise statement
body: <p>In the flask documentation there is an example for a hook function that allows to add custom behaviour for the <code>url_for</code> function by being called, when no flask-defined url endpoint is found. The programmer can add a custom endpoint or re-raise the exception (with the original context) if there is no matching user defined url endpoint as well.</p>
  
  <pre><code>def external_url_handler(error, endpoint, values):
      "Looks up an external URL when `url_for` cannot build a URL."
      # This is an example of hooking the build_error_handler.
      # Here, lookup_url is some utility function you've built
      # which looks up the endpoint in some external URL registry.
      url = lookup_url(endpoint, **values)
      if url is None:
          # External lookup did not have a URL.
          # Re-raise the BuildError, in context of original traceback.
          exc_type, exc_value, tb = sys.exc_info()
          if exc_value is error:
              raise exc_type, exc_value, tb
          else:
              raise error
      # url_for will use this result, instead of raising BuildError.
      return url
  
  app.url_build_error_handlers.append(external_url_handler)
  </code></pre>
  
  <p>This code snippet seems to be python2 code and fails for python3 because of the <code>raise exc_type, exc_value, tb</code> line.
  The <a href="https://docs.python.org/2.7/reference/simple_stmts.html#raise" rel="nofollow noreferrer">python2</a> and <a href="https://docs.python.org/3.4/reference/simple_stmts.html#raise" rel="nofollow noreferrer">python3</a> documentation list different arguments for the raise statement.</p>
  
  <p>What is the correct way to convert this snippet to python3?</p>