@@ -63,7 +63,7 @@ def test_select_error(self):
6363 +-- InterruptedError EINTR
6464 +-- IsADirectoryError EISDIR
6565 +-- NotADirectoryError ENOTDIR
66- +-- PermissionError EACCES, EPERM
66+ +-- PermissionError EACCES, EPERM, ENOTCAPABLE
6767 +-- ProcessLookupError ESRCH
6868 +-- TimeoutError ETIMEDOUT
6969 """
@@ -75,6 +75,8 @@ def _make_map(s):
7575 continue
7676 excname , _ , errnames = line .partition (' ' )
7777 for errname in filter (None , errnames .strip ().split (', ' )):
78+ if errname == "ENOTCAPABLE" and not hasattr (errno , errname ):
79+ continue
7880 _map [getattr (errno , errname )] = getattr (builtins , excname )
7981 return _map
8082 _map = _make_map (_pep_map )
@@ -91,7 +93,7 @@ def test_errno_mapping(self):
9193 othercodes = set (errno .errorcode ) - set (self ._map )
9294 for errcode in othercodes :
9395 e = OSError (errcode , "Some message" )
94- self .assertIs (type (e ), OSError )
96+ self .assertIs (type (e ), OSError , repr ( e ) )
9597
9698 def test_try_except (self ):
9799 filename = "some_hopefully_non_existing_file"
0 commit comments