MCPcopy Index your code
hub / github.com/python/mypy / CompileError

Class CompileError

mypy/errors.py:1287–1311  ·  view source on GitHub ↗

Exception raised when there is a compile error. It can be a parse, semantic analysis, type check or other compilation-related error. CompileErrors raised from an errors object carry all of the messages that have not been reported out by error streaming. This is patched up by bu

Source from the content-addressed store, hash-verified

1285
1286
1287class CompileError(Exception):
1288 """Exception raised when there is a compile error.
1289
1290 It can be a parse, semantic analysis, type check or other
1291 compilation-related error.
1292
1293 CompileErrors raised from an errors object carry all of the
1294 messages that have not been reported out by error streaming.
1295 This is patched up by build.build to contain either all error
1296 messages (if errors were streamed) or none (if they were not).
1297
1298 """
1299
1300 messages: list[str]
1301 use_stdout = False
1302 # Can be set in case there was a module with a blocking error
1303 module_with_blocker: str | None = None
1304
1305 def __init__(
1306 self, messages: list[str], use_stdout: bool = False, module_with_blocker: str | None = None
1307 ) -> None:
1308 super().__init__("\n".join(messages))
1309 self.messages = messages
1310 self.use_stdout = use_stdout
1311 self.module_with_blocker = module_with_blocker
1312
1313
1314def remove_path_prefix(path: str, prefix: str | None) -> str:

Callers 12

get_search_dirsFunction · 0.90
build_errorFunction · 0.90
get_sourceMethod · 0.90
find_module_and_diagnoseFunction · 0.90
readMethod · 0.90
test_semanalFunction · 0.90
run_caseMethod · 0.90
run_caseMethod · 0.90
test_transformFunction · 0.90
parse_and_typecheckFunction · 0.90
raise_errorMethod · 0.85

Calls

no outgoing calls

Tested by 5

test_semanalFunction · 0.72
run_caseMethod · 0.72
run_caseMethod · 0.72
test_transformFunction · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…