File tree Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -1458,13 +1458,14 @@ def set_strict_flags() -> None:
14581458
14591459 options .process_incomplete_features (error_callback = parser .error , warning_callback = print )
14601460
1461- def on_plugins_loaded () -> None :
1462- # Processing error codes after plugins have loaded since plugins may
1463- # register custom error codes that we don't know about until plugins
1464- # have loaded.
1465- options .process_error_codes (error_callback = parser .error )
1466-
1467- options ._on_plugins_loaded = on_plugins_loaded
1461+ def _bad_error_code_flags (msg : str ):
1462+ raise CompileError ([msg ])
1463+
1464+ # Processing error codes after plugins have loaded since plugins may
1465+ # register custom error codes that we don't know about until plugins
1466+ # have loaded.
1467+ options ._on_plugins_loaded = \
1468+ lambda : options .process_error_codes (error_callback = _bad_error_code_flags )
14681469
14691470 # Compute absolute path for custom typeshed (if present).
14701471 if options .custom_typeshed_dir is not None :
You can’t perform that action at this time.
0 commit comments