Skip to content

Commit 544ba83

Browse files
committed
Use standard formatting where possible
1 parent d5bf1b9 commit 544ba83

3 files changed

Lines changed: 9 additions & 9 deletions

File tree

mypy/build.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff 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)

test-data/unit/cmdline.test

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1065,8 +1065,8 @@ except ValueError:
10651065
from typing import *
10661066
sys.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]

test-data/unit/pythoneval.test

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1518,8 +1518,8 @@ async def foo() -> None:
15181518
x = 0
15191519
1 + ''
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]

0 commit comments

Comments
 (0)