diff --git a/src/lightning/pytorch/trainer/call.py b/src/lightning/pytorch/trainer/call.py index 5a7e32e619ab9d..b0a5560f4b46de 100644 --- a/src/lightning/pytorch/trainer/call.py +++ b/src/lightning/pytorch/trainer/call.py @@ -51,7 +51,7 @@ def _call_and_handle_interrupt(trainer: "pl.Trainer", trainer_fn: Callable, *arg trainer.state.status = TrainerStatus.FINISHED trainer.state.stage = None - except KeyboardInterrupt as exception: + except KeyboardInterrupt: rank_zero_warn("Detected KeyboardInterrupt, attempting graceful shutdown...") # user could press Ctrl+C many times, disable KeyboardInterrupt for shutdown signal.signal(signal.SIGINT, signal.SIG_IGN)