@@ -63,7 +63,7 @@ def test_select_error(self):
63
63
+-- InterruptedError EINTR
64
64
+-- IsADirectoryError EISDIR
65
65
+-- NotADirectoryError ENOTDIR
66
- +-- PermissionError EACCES, EPERM
66
+ +-- PermissionError EACCES, EPERM, ENOTCAPABLE
67
67
+-- ProcessLookupError ESRCH
68
68
+-- TimeoutError ETIMEDOUT
69
69
"""
@@ -75,6 +75,8 @@ def _make_map(s):
75
75
continue
76
76
excname , _ , errnames = line .partition (' ' )
77
77
for errname in filter (None , errnames .strip ().split (', ' )):
78
+ if errname == "ENOTCAPABLE" and not hasattr (errno , errname ):
79
+ continue
78
80
_map [getattr (errno , errname )] = getattr (builtins , excname )
79
81
return _map
80
82
_map = _make_map (_pep_map )
@@ -91,7 +93,7 @@ def test_errno_mapping(self):
91
93
othercodes = set (errno .errorcode ) - set (self ._map )
92
94
for errcode in othercodes :
93
95
e = OSError (errcode , "Some message" )
94
- self .assertIs (type (e ), OSError )
96
+ self .assertIs (type (e ), OSError , repr ( e ) )
95
97
96
98
def test_try_except (self ):
97
99
filename = "some_hopefully_non_existing_file"
0 commit comments