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.
This commit is contained in:
parent
cf30adf38d
commit
4a2fee8b1c
@ -23,7 +23,7 @@ import sys
|
|||||||
import faulthandler
|
import faulthandler
|
||||||
import textwrap
|
import textwrap
|
||||||
import traceback
|
import traceback
|
||||||
from signal import SIGUSR1
|
import signal
|
||||||
|
|
||||||
|
|
||||||
# Now we initialize the faulthandler as early as possible, so we theoretically
|
# 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.
|
# crashes to the user at the next start.
|
||||||
return
|
return
|
||||||
faulthandler.enable()
|
faulthandler.enable()
|
||||||
if hasattr(faulthandler, 'register'):
|
if hasattr(faulthandler, 'register') and hasattr(signal, 'SIGUSR1'):
|
||||||
# If available, we also want a traceback on 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
|
# Now the faulthandler is enabled we fix the Qt harfbuzzing library, before
|
||||||
|
Loading…
Reference in New Issue
Block a user