]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-43989: Add signal format specifier for unix_events (GH-25769)
authorRoberto Hueso <robertohueso96@gmail.com>
Sat, 1 May 2021 20:34:29 +0000 (22:34 +0200)
committerGitHub <noreply@github.com>
Sat, 1 May 2021 20:34:29 +0000 (13:34 -0700)
Add format specifier for IntEnum references to avoid 3.12 deprecation warning.

Lib/asyncio/unix_events.py

index e4f445e95026b55e7060a496d4da9841f1bc0e12..a55b3a375fa22d7bb306c54e6ef34834a4c36385 100644 (file)
@@ -126,7 +126,7 @@ class _UnixSelectorEventLoop(selector_events.BaseSelectorEventLoop):
                     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 @@ class _UnixSelectorEventLoop(selector_events.BaseSelectorEventLoop):
             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