From d02cdf4df2104984ad03d66fca98e373298272b8 Mon Sep 17 00:00:00 2001 From: Roberto Hueso Gomez Date: Sat, 1 May 2021 03:30:11 +0200 Subject: [PATCH] Add signal format specifier for unix_events This adds a format specifier for IntEnum so that we can avoid 3.12 deprecation warning. --- Lib/asyncio/unix_events.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Lib/asyncio/unix_events.py b/Lib/asyncio/unix_events.py index e4f445e95026b5..a55b3a375fa22d 100644 --- a/Lib/asyncio/unix_events.py +++ b/Lib/asyncio/unix_events.py @@ -126,7 +126,7 @@ def add_signal_handler(self, sig, callback, *args): logger.info('set_wakeup_fd(-1) failed: %s', nexc) if exc.errno == errno.EINVAL: - raise RuntimeError(f'sig {sig} cannot be caught') + raise RuntimeError(f'sig {sig:d} cannot be caught') else: raise @@ -160,7 +160,7 @@ def remove_signal_handler(self, sig): signal.signal(sig, handler) except OSError as exc: if exc.errno == errno.EINVAL: - raise RuntimeError(f'sig {sig} cannot be caught') + raise RuntimeError(f'sig {sig:d} cannot be caught') else: raise