File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -1796,8 +1796,11 @@ def parse_file(self) -> None:
1796
1796
source = manager .fscache .read_with_python_encoding (path )
1797
1797
self .source_hash = manager .fscache .md5 (path )
1798
1798
except IOError as ioerr :
1799
+ # ioerr.strerror differs for os.stat failures between Windows and
1800
+ # other systems, but os.strerror(ioerr.errno) does not, so we use that.
1799
1801
raise CompileError ([
1800
- "mypy: can't read file '{}': {}" .format (self .path , ioerr .strerror )])
1802
+ "mypy: can't read file '{}': {}" .format (
1803
+ self .path , os .strerror (ioerr .errno ))])
1801
1804
except (UnicodeDecodeError , DecodeError ) as decodeerr :
1802
1805
raise CompileError ([
1803
1806
"mypy: can't decode file '{}': {}" .format (self .path , str (decodeerr ))])
You can’t perform that action at this time.
0 commit comments