Fix #165125: Type "str" is not assignable to return type "None" (#165128)

Fixes #165125

Pull Request resolved: https://github.com/pytorch/pytorch/pull/165128
Approved by: https://github.com/malfet
This commit is contained in:
Wu, Zhenyu
2025-10-10 16:05:07 +00:00
committed by PyTorch MergeBot
parent fb64da0791
commit b57ab9a3f2

View File

@ -11,6 +11,7 @@ import setuptools
import subprocess
import sys
import sysconfig
import types
import collections
from pathlib import Path
import errno
@ -2095,7 +2096,7 @@ def _jit_compile(name,
with_sycl: Optional[bool],
is_python_module,
is_standalone,
keep_intermediates=True) -> None:
keep_intermediates=True) -> Union[types.ModuleType, str]:
if is_python_module and is_standalone:
raise ValueError("`is_python_module` and `is_standalone` are mutually exclusive.")