mirror of
https://github.com/python/cpython.git
synced 2025-09-26 10:19:53 +00:00
Fix issue #8573 (asyncore._strerror bug): fixed os.strerror typo; included NameError in the tuple of expected exception; added test case for asyncore._strerror.
This commit is contained in:
parent
cccfce1959
commit
e3a84e857f
2 changed files with 11 additions and 2 deletions
|
@ -63,8 +63,8 @@ except NameError:
|
|||
|
||||
def _strerror(err):
|
||||
try:
|
||||
return strerror(err)
|
||||
except (ValueError, OverflowError):
|
||||
return os.strerror(err)
|
||||
except (ValueError, OverflowError, NameError):
|
||||
if err in errorcode:
|
||||
return errorcode[err]
|
||||
return "Unknown error %s" %err
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue