raise *error doesn't work in Python 2.7; how can I raise a previously captured exception?
<p>My code works, but I am thinking there is something wrong with my understanding, or possibly (gasp) an error in Python's <code>raise</code> behavior.</p>

<p>I am looping over a set of arguments.  I capture the <em>first</em> error and want to raise it after I have finished looping, with the original traceback etc as described in <a href="https://stackoverflow.com/questions/1350671/inner-exception-with-traceback-in-python">“Inner exception” (with traceback) in Python?</a></p>

<p>I obviously want the loop to process all the arguments, and only then tell me what went wrong.</p>

<pre><code>error = None
for arg in arguments:
    try:
        process(arg)
    except ValueError, err:
        if not error:
            error = sys.exc_info()
if error:
    raise error[0], error[1], error[2]
</code></pre>

<p>The last line is the problematic line.  It works (demo: <a href="http://ideone.com/HFZETm" rel="nofollow noreferrer">http://ideone.com/HFZETm</a> -- note how it prints the traceback from the first error, not the last one), but it seems extremely clunky.  How could I express that more succinctly?</p>

<p><code>raise error</code> would seem more elegant, but it behaves as if I had simply <code>raise error[0]</code> (or perhaps raise <code>error[1]</code>).  <code>raise *error</code> is a syntax error. </p>