File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -921,12 +921,12 @@ def __init__(
921921 ):
922922 continue
923923
924- raise CompileError (
925- [
926- f'mypy: error: "{ os .path .relpath (path )} " shadows library module "{ module } "' ,
927- f'note: A user-defined top-level module with name "{ module } " is not supported' ,
928- ]
924+ self .errors .set_file (path , module , options )
925+ self .error (None , f'This file shadows library module "{ module } "' , blocker = True )
926+ self .note (
927+ None , f'A user-defined top-level module with name "{ module } " is not supported'
929928 )
929+ self .errors .raise_error ()
930930
931931 if metastore is None :
932932 metastore = create_metastore (options , parallel_worker = parallel_worker )
Original file line number Diff line number Diff line change @@ -1065,8 +1065,8 @@ except ValueError:
10651065from typing import *
10661066sys.path = path
10671067[out]
1068- mypy : error: "typing.py" shadows library module "typing"
1069- note: A user-defined top-level module with name "typing" is not supported
1068+ typing.py : error: This file shadows library module "typing"
1069+ typing.py: note: A user-defined top-level module with name "typing" is not supported
10701070== Return code: 2
10711071
10721072[case testCustomTypeshedDirWithRelativePathDoesNotCrash]
Original file line number Diff line number Diff line change @@ -1518,8 +1518,8 @@ async def foo() -> None:
15181518x = 0
151915191 + ''
15201520[out]
1521- mypy : error: "tmp/typing.py" shadows library module "typing"
1522- note: A user-defined top-level module with name "typing" is not supported
1521+ typing.py : error: This file shadows library module "typing"
1522+ typing.py: note: A user-defined top-level module with name "typing" is not supported
15231523
15241524
15251525[case testNoPython3StubAvailable]
You can’t perform that action at this time.
0 commit comments