From d8d4b4f15a64298f7dddbcc82c138eae512dabe7 Mon Sep 17 00:00:00 2001 From: Jakub Kuczys Date: Mon, 24 Apr 2023 20:29:51 +0200 Subject: [PATCH] Improve consistency of shutdown message across Python versions (#6095) --- redbot/__main__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/redbot/__main__.py b/redbot/__main__.py index 716ae1af4..b0fe289da 100644 --- a/redbot/__main__.py +++ b/redbot/__main__.py @@ -420,7 +420,7 @@ def handle_early_exit_flags(cli_flags: Namespace): async def shutdown_handler(red, signal_type=None, exit_code=None): if signal_type: - log.info("%s received. Quitting...", signal_type) + log.info("%s received. Quitting...", signal_type.name) # Do not collapse the below line into other logic # We need to renter this function # after it interrupts the event loop. @@ -525,7 +525,7 @@ def main(): # We also have to catch this one here. Basically any exception which normally # Kills the python interpreter (Base Exceptions minus asyncio.cancelled) # We need to do something with prior to having the loop close - log.info("Shutting down with exit code: %s", exc.code) + log.info("Shutting down with exit code: %s (%s)", exc.code.value, exc.code.name) if red is not None: loop.run_until_complete(shutdown_handler(red, None, exc.code)) except Exception as exc: # Non standard case.