@@ -200,12 +200,9 @@ def run(self) -> None:
200
200
self .requester = Requester ()
201
201
if options ["async_mode" ]:
202
202
self .loop = asyncio .new_event_loop ()
203
- try :
204
- self .loop .add_signal_handler (signal .SIGINT , self .handle_pause )
205
- except NotImplementedError :
206
- # Windows
207
- signal .signal (signal .SIGINT , self .handle_pause )
208
- signal .signal (signal .SIGTERM , self .handle_pause )
203
+
204
+ signal .signal (signal .SIGINT , lambda * _ : self .handle_pause ())
205
+ signal .signal (signal .SIGTERM , lambda * _ : self .handle_pause ())
209
206
210
207
while options ["urls" ]:
211
208
url = options ["urls" ][0 ]
@@ -509,18 +506,14 @@ def is_timed_out(self) -> bool:
509
506
510
507
def process (self ) -> None :
511
508
while True :
512
- try :
513
- while not self .fuzzer .is_finished ():
514
- if self .is_timed_out ():
515
- raise SkipTargetInterrupt (
516
- "Runtime exceeded the maximum set by the user"
517
- )
518
- time .sleep (0.5 )
519
-
520
- break
509
+ while not self .fuzzer .is_finished ():
510
+ if self .is_timed_out ():
511
+ raise SkipTargetInterrupt (
512
+ "Runtime exceeded the maximum set by the user"
513
+ )
514
+ time .sleep (0.5 )
521
515
522
- except KeyboardInterrupt :
523
- self .handle_pause ()
516
+ break
524
517
525
518
def add_directory (self , path : str ) -> None :
526
519
"""Add directory to the recursion queue"""
0 commit comments