title: Python-TypeError: __init__() takes exactly 3 arguments (4 given)
body: <p>I have the following class and function in my program:</p>
  
  <pre><code>class RaiseAndTurnOff(Exception):
      def __init__(self, value, r1):
          self.value = value
          r1.turn_off_gracefully()
      def __str__(self):
          return repr(self.value)
  
  def assert_state(self, state):
      if not(self.link.is_in_state(state)):
          raise RaiseAndTurnOff("Sanity check error: Link should be %s, but it is not! please check the log file reports. Exiting script" % state, self, self.params)
  </code></pre>
  
  <p>As you can see I send 3 arguments. For some reason I got the following error:</p>
  
  <pre><code>File "qalib.py", line 103, in assert_state
      raise RaiseAndTurnOff("Sanity check error: Link should be %s, but it is not! please check the log file reports. Exiting script" % state, self, self.params)
  TypeError: __init__() takes exactly 3 arguments (4 given)
  </code></pre>