Changeset 2908

Show
Ignore:
Timestamp:
12/30/07 15:07:46 (1 year ago)
Author:
vivainio
Message:

some extra keyboardinterrupt catching, and raw_input in crash handler (which typically disappears without trace on win32

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • ipython/trunk/IPython/CrashHandler.py

    r1828 r2908  
    155155        report.write(self.make_report(traceback)) 
    156156        report.close() 
     157        raw_input("Press enter to exit:") 
    157158 
    158159    def make_report(self,traceback): 
  • ipython/trunk/IPython/iplib.py

    r2899 r2908  
    219219            if ns is not None and type(ns) != types.DictType: 
    220220                raise TypeError,'namespace must be a dictionary' 
    221  
    222221        # Job manager (for jobs run as background threads) 
    223222        self.jobs = BackgroundJobManager() 
     
    15521551                banner = self.BANNER+self.banner2 
    15531552 
    1554         self.interact(banner) 
     1553        while 1: 
     1554            try: 
     1555                self.interact(banner) 
     1556            except KeyboardInterrupt: 
     1557                # this should not be necessary, but KeyboardInterrupt 
     1558                # handling seems rather unpredictable... 
     1559                self.write("\nKeyboardInterrupt in interact()\n") 
    15551560 
    15561561    def exec_init_cmd(self): 
     
    16831688                     
    16841689            except KeyboardInterrupt: 
    1685                 self.write('\nKeyboardInterrupt\n') 
    1686                 self.resetbuffer() 
    1687                 # keep cache in sync with the prompt counter: 
    1688                 self.outputcache.prompt_count -= 1 
    1689  
    1690                 if self.autoindent: 
    1691                     self.indent_current_nsp = 0 
    1692                 more = 0 
     1690                #double-guard against keyboardinterrupts during kbdint handling 
     1691                try: 
     1692                    self.write('\nKeyboardInterrupt\n') 
     1693                    self.resetbuffer() 
     1694                    # keep cache in sync with the prompt counter: 
     1695                    self.outputcache.prompt_count -= 1 
     1696     
     1697                    if self.autoindent: 
     1698                        self.indent_current_nsp = 0 
     1699                    more = 0 
     1700                except KeyboardInterrupt: 
     1701                    pass 
    16931702            except EOFError: 
    16941703                if self.autoindent: 
  • ipython/trunk/IPython/ultraTB.py

    r2907 r2908  
    870870            self.debugger() 
    871871        except KeyboardInterrupt: 
    872             print "KeyboardInterrupt" 
     872            print "\nKeyboardInterrupt" 
    873873 
    874874#---------------------------------------------------------------------------- 
     
    988988            self.debugger() 
    989989        except KeyboardInterrupt: 
    990             print "KeyboardInterrupt" 
     990            print "\nKeyboardInterrupt" 
    991991 
    992992    def text(self,etype=None,value=None,tb=None,context=5,mode=None):