diff options
author | AN Long <aisk@users.noreply.github.com> | 2024-07-25 11:56:04 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-07-25 11:56:04 (GMT) |
commit | 070f1e2e5b9b31ee3e7a1af2e30d7e3a66040b17 (patch) | |
tree | ff677cb010fabc492432ae8b6a4e955988419c0e /Lib/asyncio | |
parent | 6c09b8de5c67406113e8d082e05c9587e35a852a (diff) | |
download | cpython-070f1e2e5b9b31ee3e7a1af2e30d7e3a66040b17.zip cpython-070f1e2e5b9b31ee3e7a1af2e30d7e3a66040b17.tar.gz cpython-070f1e2e5b9b31ee3e7a1af2e30d7e3a66040b17.tar.bz2 |
gh-121913: Use str(exc) instead of exc.strerror in `asyncio.base_events` (#122269)
Diffstat (limited to 'Lib/asyncio')
-rw-r--r-- | Lib/asyncio/base_events.py | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/Lib/asyncio/base_events.py b/Lib/asyncio/base_events.py index f0e690b..e4a39f4 100644 --- a/Lib/asyncio/base_events.py +++ b/Lib/asyncio/base_events.py @@ -1028,8 +1028,7 @@ class BaseEventLoop(events.AbstractEventLoop): except OSError as exc: msg = ( f'error while attempting to bind on ' - f'address {laddr!r}: ' - f'{exc.strerror.lower()}' + f'address {laddr!r}: {str(exc).lower()}' ) exc = OSError(exc.errno, msg) my_exceptions.append(exc) @@ -1599,7 +1598,7 @@ class BaseEventLoop(events.AbstractEventLoop): except OSError as err: msg = ('error while attempting ' 'to bind on address %r: %s' - % (sa, err.strerror.lower())) + % (sa, str(err).lower())) if err.errno == errno.EADDRNOTAVAIL: # Assume the family is not enabled (bpo-30945) sockets.pop() |