1130 IDEFrame.ShowHighlight(self, infos, start, end, highlight_type) |
1130 IDEFrame.ShowHighlight(self, infos, start, end, highlight_type) |
1131 |
1131 |
1132 #------------------------------------------------------------------------------- |
1132 #------------------------------------------------------------------------------- |
1133 # Exception Handler |
1133 # Exception Handler |
1134 #------------------------------------------------------------------------------- |
1134 #------------------------------------------------------------------------------- |
|
1135 import threading, traceback |
1135 |
1136 |
1136 Max_Traceback_List_Size = 20 |
1137 Max_Traceback_List_Size = 20 |
1137 |
1138 |
1138 def Display_Exception_Dialog(e_type, e_value, e_tb, bug_report_path): |
1139 def Display_Exception_Dialog(e_type, e_value, e_tb, bug_report_path): |
1139 trcbck_lst = [] |
1140 trcbck_lst = [] |
1224 output.write(a+":\n"+str(info[a])+"\n\n") |
1225 output.write(a+":\n"+str(info[a])+"\n\n") |
1225 |
1226 |
1226 #sys.excepthook = lambda *args: wx.CallAfter(handle_exception, *args) |
1227 #sys.excepthook = lambda *args: wx.CallAfter(handle_exception, *args) |
1227 sys.excepthook = handle_exception |
1228 sys.excepthook = handle_exception |
1228 |
1229 |
|
1230 init_old = threading.Thread.__init__ |
|
1231 def init(self, *args, **kwargs): |
|
1232 init_old(self, *args, **kwargs) |
|
1233 run_old = self.run |
|
1234 def run_with_except_hook(*args, **kw): |
|
1235 try: |
|
1236 run_old(*args, **kw) |
|
1237 except (KeyboardInterrupt, SystemExit): |
|
1238 raise |
|
1239 except: |
|
1240 sys.excepthook(*sys.exc_info()) |
|
1241 self.run = run_with_except_hook |
|
1242 threading.Thread.__init__ = init |
|
1243 |
1229 if __name__ == '__main__': |
1244 if __name__ == '__main__': |
1230 # Install a exception handle for bug reports |
1245 # Install a exception handle for bug reports |
1231 AddExceptHook(os.getcwd(),updateinfo_url) |
1246 AddExceptHook(os.getcwd(),updateinfo_url) |
1232 |
1247 |
1233 frame = Beremiz(None, projectOpen, buildpath) |
1248 frame = Beremiz(None, projectOpen, buildpath) |