title: Exception is thrown delayed
body: <p>I have the following script in Python:</p>
  
  <pre><code>import sys
  
  
  for filename in sys.argv:
      with open(filename, mode='r') as f:
          print("Foobar")
  </code></pre>
  
  <p>If I start the script with a nonexisting filename as a parameter, I get an exception, as expected. However, the <code>print()</code> is still executed, even though I expect that it isn't.</p>
  
  <pre><code>Foobar
  Traceback (most recent call last):
    File "home/bin/ksp-increment-build", line 16, in &lt;module&gt;
      with open(filename, mode='r') as f:
  FileNotFoundError: [Errno 2] No such file or directory: 'asdads'
  </code></pre>
  
  <p>Why is this?</p>