code: def PopState(self, **_):
      
      try:
        self.state = self.state_stack.pop()
        if self.verbose:
          logging.debug("Returned state to %s", self.state)
  
        return self.state
      except IndexError:
        self.Error("Tried to pop the state but failed - possible recursion error")
docs: Pop the previous state from the stack.