Crash more reliably (lol'd)

This commit is contained in:
Florian Bruhin 2014-02-05 11:40:30 +01:00
parent 888c1690de
commit fc7caee370
2 changed files with 4 additions and 5 deletions

View File

@ -4,6 +4,7 @@ import os
import sys
import logging
import traceback
import subprocess
import faulthandler
from signal import signal, SIGINT
from argparse import ArgumentParser
@ -148,6 +149,7 @@ class QuteBrowser(QApplication):
except Exception:
history = []
QApplication.closeAllWindows()
dlg = CrashDialog(pages, history, exc)
ret = dlg.exec_()
if ret == QDialog.Accepted: # restore
@ -157,11 +159,7 @@ class QuteBrowser(QApplication):
argv = [sys.executable] + sys.argv + pages
logging.debug('Running {} with args {}'.format(sys.executable,
argv))
config.config.save()
sys.stdout.flush()
# FIXME this seems broken on Windows, execv() splits on whitespace
# in arguments?!?
os.execv(sys.executable, argv)
subprocess.Popen(argv)
self.exit(1)
def _python_hacks(self):

View File

@ -16,6 +16,7 @@ class CrashDialog(QDialog):
super().__init__()
self.setFixedSize(500, 350)
self.setWindowTitle('Whoops!')
self.setModal(True)
vbox = QVBoxLayout()
lbl = QLabel(self)