Skip to content

Commit ccc1abf

Browse files
authored
[Pytorch] Fix UnboundLocalError during build (#2116)
Fix UnboundLocalError Signed-off-by: Kirthi Shankar Sivamani <[email protected]>
1 parent 47ab4a7 commit ccc1abf

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

build_tools/utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
import subprocess
1414
import sys
1515
from pathlib import Path
16-
from importlib.metadata import version
16+
from importlib.metadata import version as get_version
1717
from subprocess import CalledProcessError
1818
from typing import List, Optional, Tuple, Union
1919

@@ -269,7 +269,7 @@ def cuda_version() -> Tuple[int, ...]:
269269
return tuple(int(v) for v in version)
270270

271271
try:
272-
version_str = version("nvidia-cuda-runtime-cu12")
272+
version_str = get_version("nvidia-cuda-runtime-cu12")
273273
version_tuple = tuple(int(part) for part in version_str.split(".") if part.isdigit())
274274
return version_tuple
275275
except importlib.metadata.PackageNotFoundError:

0 commit comments

Comments
 (0)