mirror of
https://github.com/python/cpython.git
synced 2025-09-27 02:39:58 +00:00
[3.12] gh-121913: Use str(exc) instead of exc.strerror in asyncio.base_events
(GH-122269) (#122279)
gh-121913: Use str(exc) instead of exc.strerror in `asyncio.base_events` (GH-122269)
(cherry picked from commit 070f1e2e5b
)
Co-authored-by: AN Long <aisk@users.noreply.github.com>
This commit is contained in:
parent
02c19f0338
commit
0300e33b22
1 changed files with 2 additions and 3 deletions
|
@ -994,8 +994,7 @@ class BaseEventLoop(events.AbstractEventLoop):
|
||||||
except OSError as exc:
|
except OSError as exc:
|
||||||
msg = (
|
msg = (
|
||||||
f'error while attempting to bind on '
|
f'error while attempting to bind on '
|
||||||
f'address {laddr!r}: '
|
f'address {laddr!r}: {str(exc).lower()}'
|
||||||
f'{exc.strerror.lower()}'
|
|
||||||
)
|
)
|
||||||
exc = OSError(exc.errno, msg)
|
exc = OSError(exc.errno, msg)
|
||||||
my_exceptions.append(exc)
|
my_exceptions.append(exc)
|
||||||
|
@ -1561,7 +1560,7 @@ class BaseEventLoop(events.AbstractEventLoop):
|
||||||
except OSError as err:
|
except OSError as err:
|
||||||
msg = ('error while attempting '
|
msg = ('error while attempting '
|
||||||
'to bind on address %r: %s'
|
'to bind on address %r: %s'
|
||||||
% (sa, err.strerror.lower()))
|
% (sa, str(err).lower()))
|
||||||
if err.errno == errno.EADDRNOTAVAIL:
|
if err.errno == errno.EADDRNOTAVAIL:
|
||||||
# Assume the family is not enabled (bpo-30945)
|
# Assume the family is not enabled (bpo-30945)
|
||||||
sockets.pop()
|
sockets.pop()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue