From 4a2fee8b1cf1512e3b855215b829ae000d58d59e Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Wed, 14 May 2014 08:52:40 +0200 Subject: [PATCH] Fix earlyinit to run properly on Windows. signal.SIGUSR1 is not available on Windows so we import signal and check dynamically if SIGUSR1 is available instead. --- qutebrowser/utils/earlyinit.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/qutebrowser/utils/earlyinit.py b/qutebrowser/utils/earlyinit.py index dcd692987..ce4dede80 100644 --- a/qutebrowser/utils/earlyinit.py +++ b/qutebrowser/utils/earlyinit.py @@ -23,7 +23,7 @@ import sys import faulthandler import textwrap import traceback -from signal import SIGUSR1 +import signal # Now we initialize the faulthandler as early as possible, so we theoretically @@ -44,9 +44,9 @@ def init_faulthandler(): # crashes to the user at the next start. return faulthandler.enable() - if hasattr(faulthandler, 'register'): + if hasattr(faulthandler, 'register') and hasattr(signal, 'SIGUSR1'): # If available, we also want a traceback on SIGUSR1. - faulthandler.register(SIGUSR1) + faulthandler.register(signal.SIGUSR1) # Now the faulthandler is enabled we fix the Qt harfbuzzing library, before