def _execute(self):
        '''
        Executes the current line provided by the shell object.
        '''

        orig_stdout = sys.stdout
        sys.stdout = Term.cout
        #self.sys_displayhook_ori = sys.displayhook
        #sys.displayhook = self.displayhook
        
        try:
            line = self._IP.raw_input(None, self._iter_more)
            if self._IP.autoindent:
                self._IP.readline_startup_hook(None)

        except __HOLE__:
            self._IP.write('\nKeyboardInterrupt\n')
            self._IP.resetbuffer()
            # keep cache in sync with the prompt counter:
            self._IP.outputcache.prompt_count -= 1

            if self._IP.autoindent:
                self._IP.indent_current_nsp = 0
            self._iter_more = 0
        except:
            self._IP.showtraceback()
        else:
            self._IP.write(str(self._IP.outputcache.prompt_out).strip())
            self._iter_more = self._IP.push_line(line)
            if (self._IP.SyntaxTB.last_syntax_error and \
                                                            self._IP.autoedit_syntax):
                self._IP.edit_syntax_error()
        if self._iter_more:
            self._prompt = str(self._IP.outputcache.prompt2).strip()
            if self._IP.autoindent:
                self._IP.readline_startup_hook(self._IP.pre_readline)
        else:
            self._prompt = str(self._IP.outputcache.prompt1).strip()
            self._IP.indent_current_nsp = 0 #we set indentation to 0

        sys.stdout = orig_stdout
        #sys.displayhook = self.sys_displayhook_ori
dataset/ETHPy150Open ipython/ipython-py3k/IPython/deathrow/gui/wx/ipshell_nonblocking.py/NonBlockingIPShell._execute