title: Using raise function to stop execution of further code in python after an error
body: <p>I use <code>raise</code> function in python 2.7 as a way to stop further code being executed, without exiting, when a condition is not met. This is shown in example below:</p>
  
  <pre><code>from Tkinter import *
  import tkMessageBox
  
  def foo():
      a = 3
      if a == 2:
          tkMessageBox.showinfo('Hello', 'Yup yup yup')
      else:
          tkMessageBox.showinfo('Hello', 'My bad!')
          raise
  
      tkMessageBox.showinfo('Further code' ,"You shouldn't see me if a is not 2")
  
  app = Tk()
  app.title("ABC")
  app.geometry()
  
  
  filetype_fasta = [('fasta files', '*.fasta'), ('All files', '*.*')]
  button_templ = Button(app, text = 'Click me', width =6, command = foo)
  button_templ.grid(row = 3, column = 2)
  
  app.mainloop()
  </code></pre>
  
  <p>It works fine for a complicated script I have. My question is this - Is there any potential problem, that I should be aware of, in using <code>raise</code> this way? If yes, is there a better/common method to do the same thing?</p>
  
  <p>Edit: Example changed to demonstrate the idea better.</p>