@@ -123,7 +123,6 @@ def _load(module_name: str, config: ResolvedConfig) -> None:
123123
124124
125125class _JITCompileStep (ABC ):
126- exception_cls = type (None )
127126 step_name = "<None>"
128127
129128 def __init__ (self : Self , module_name : str , config : ResolvedConfig , step_number : tuple [int , int ]) -> None :
@@ -150,7 +149,6 @@ def _run_impl(self: Self) -> None:
150149
151150
152151class _CleanStep (_JITCompileStep ):
153- exception_cls = type (None )
154152 step_name = "Clean"
155153
156154 def __init__ (self : Self , module_name : str , config : ResolvedConfig , step_number : tuple [int , int ]) -> None :
@@ -236,7 +234,6 @@ def _torch_version_changed(self: Self) -> bool:
236234
237235
238236class _InitializeStep (_JITCompileStep ):
239- exception_cls = type (None )
240237 step_name = "Initialize"
241238
242239 def __init__ (self : Self , module_name : str , config : ResolvedConfig , step_number : tuple [int , int ]) -> None :
@@ -255,7 +252,6 @@ def _run_impl(self: Self) -> None:
255252
256253
257254class _CMakeConfigureStep (_JITCompileStep ):
258- exception_cls = CMakeConfigureError
259255 step_name = "CMake Configure"
260256
261257 def __init__ (self : Self , module_name : str , config : ResolvedConfig , step_number : tuple [int , int ]) -> None :
@@ -301,7 +297,7 @@ def _run_impl(self: Self) -> None:
301297 self .cache ["cmake_configure_command" ] = configure_command
302298 self .cache ["status_cmake_configure" ] = status
303299 if status == _StepStatus .FAILED :
304- raise self . exception_cls (log )
300+ raise CMakeConfigureError (log )
305301
306302 def _cmake_generator (self : Self ) -> list [str ]:
307303 return ["-G" , "Ninja Multi-Config" ] if platform .system () != "Windows" else []
@@ -314,7 +310,6 @@ def _cmake_project_top_level_includes(self: Self) -> str:
314310
315311
316312class _BuildStep (_JITCompileStep ):
317- exception_cls = BuildError
318313 step_name = "Build"
319314
320315 def __init__ (self : Self , module_name : str , config : ResolvedConfig , step_number : tuple [int , int ]) -> None :
@@ -351,11 +346,10 @@ def _run_impl(self: Self) -> None:
351346
352347 self .cache ["status_build" ] = status
353348 if status == _StepStatus .FAILED :
354- raise self . exception_cls (log )
349+ raise BuildError (log )
355350
356351
357352class _StubGenerationStep (_JITCompileStep ):
358- exception_cls = StubGenerationError
359353 step_name = "Stub Generation"
360354
361355 def __init__ (self : Self , module_name : str , config : ResolvedConfig , step_number : tuple [int , int ]) -> None :
@@ -417,7 +411,7 @@ def _run_impl(self: Self) -> None:
417411 self .cache ["checksum" ] = new_checksum
418412 self .cache ["status_stub_generation" ] = status
419413 if status == _StepStatus .FAILED :
420- raise self . exception_cls (log )
414+ raise StubGenerationError (log )
421415
422416 def _windows_dll_directories (self : Self ) -> list [str ]:
423417 windows_dll_directories : str = self .cache ["windows_dll_directories" ]
@@ -433,7 +427,6 @@ def _compute_checksum(self: Self, full_extension_path: pathlib.Path) -> str:
433427
434428
435429class _ImportPathStep (_JITCompileStep ):
436- exception_cls = type (None )
437430 step_name = "Import Path"
438431
439432 def __init__ (self : Self , module_name : str , config : ResolvedConfig , step_number : tuple [int , int ]) -> None :
0 commit comments