mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2024-11-23 00:01:36 +00:00
fix debug mode on Windows
This commit is contained in:
parent
ccf4723505
commit
3c9a70b761
@ -1,5 +1,6 @@
|
|||||||
from __future__ import (absolute_import, print_function, division)
|
from __future__ import (absolute_import, print_function, division)
|
||||||
|
|
||||||
|
import os
|
||||||
import sys
|
import sys
|
||||||
import threading
|
import threading
|
||||||
import signal
|
import signal
|
||||||
@ -93,6 +94,7 @@ def dump_stacks(signal, frame, file=sys.stdout):
|
|||||||
print("\n".join(code), file=file)
|
print("\n".join(code), file=file)
|
||||||
|
|
||||||
|
|
||||||
def register_info_dumpers(): # pragma: no cover
|
def register_info_dumpers():
|
||||||
signal.signal(signal.SIGUSR1, dump_info)
|
if os.name != "nt":
|
||||||
signal.signal(signal.SIGUSR2, dump_stacks)
|
signal.signal(signal.SIGUSR1, dump_info)
|
||||||
|
signal.signal(signal.SIGUSR2, dump_stacks)
|
||||||
|
@ -18,3 +18,7 @@ def test_dump_stacks():
|
|||||||
|
|
||||||
def test_sysinfo():
|
def test_sysinfo():
|
||||||
assert debug.sysinfo()
|
assert debug.sysinfo()
|
||||||
|
|
||||||
|
|
||||||
|
def test_register_info_dumpers():
|
||||||
|
debug.register_info_dumpers()
|
||||||
|
Loading…
Reference in New Issue
Block a user