Ignore:
Timestamp:
01/11/13 17:16:34 (16 months ago)
Author:
Ales Erjavec <ales.erjavec@…>
Branch:
default
Message:

Override sys.excepthook with a custom handler.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • Orange/OrangeCanvas/main.py

    r11257 r11258  
    2121from Orange.OrangeCanvas.application.application import CanvasApplication 
    2222from Orange.OrangeCanvas.application.canvasmain import CanvasMainWindow 
    23 from Orange.OrangeCanvas.application.outputview import TextStream 
     23from Orange.OrangeCanvas.application.outputview import TextStream, ExceptHook 
    2424 
    2525from Orange.OrangeCanvas.gui.splashscreen import SplashScreen, QPixmap 
     
    260260        stderr = sys.stderr 
    261261 
     262    if stderr_redirect: 
     263        sys.excepthook = ExceptHook() 
     264        sys.excepthook.handledException.connect(output_view.parent().show) 
     265 
    262266    with nested(redirect_stdout(stdout), redirect_stderr(stderr)): 
    263267        log.info("Entering main event loop.") 
Note: See TracChangeset for help on using the changeset viewer.