File tree Expand file tree Collapse file tree 1 file changed +10
-5
lines changed
Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -59,11 +59,15 @@ def test_navigation_to_invalid_page_resets_to_valid_page_without_deadlock():
5959 widget ._initial_load_complete = True
6060
6161 # Setup timeout to fail fast if deadlock occurs
62- def handler (signum , frame ):
63- raise TimeoutError ("Deadlock detected!" )
62+ # signal.SIGALRM is not available on Windows
63+ has_sigalrm = hasattr (signal , "SIGALRM" )
64+ if has_sigalrm :
6465
65- signal .signal (signal .SIGALRM , handler )
66- signal .alarm (2 ) # 2 seconds timeout
66+ def handler (signum , frame ):
67+ raise TimeoutError ("Deadlock detected!" )
68+
69+ signal .signal (signal .SIGALRM , handler )
70+ signal .alarm (2 ) # 2 seconds timeout
6771
6872 try :
6973 # Trigger navigation to page 5 (invalid), which should reset to page 0
@@ -72,4 +76,5 @@ def handler(signum, frame):
7276 assert widget .page == 0
7377
7478 finally :
75- signal .alarm (0 )
79+ if has_sigalrm :
80+ signal .alarm (0 )
You can’t perform that action at this time.
0 commit comments