Skip to content

Commit 6db18fb

Browse files
authored
Fix Python 3.9 typing error in tools/compile (#4946)
Fixes #4896 Python 3.9 typing issue: str | None, only works on 3.10+. Switch the union annotations to Optional. Signed-off-by: Witold Dziurdz <[email protected]>
1 parent d0bb2e3 commit 6db18fb

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

python/triton/tools/compile.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
from argparse import ArgumentParser
66
from dataclasses import dataclass
77
from pathlib import Path
8-
from typing import List
8+
from typing import List, Optional
99

1010
import triton
1111
from triton._internal_testing import is_xpu
@@ -23,12 +23,12 @@ class CompileArgs:
2323
grid: str = ''
2424
grf_mode: str = ''
2525
generate_native_code: bool = False
26-
target: str | None = None
26+
target: Optional[str] = None
2727
num_warps: int = 1
2828
threads_per_warp: int = 32
2929
num_stages: int = 3
30-
out_name: str | None = None
31-
out_path: Path | None = None
30+
out_name: Optional[str] = None
31+
out_path: Optional[Path] = None
3232

3333

3434
desc = """

0 commit comments

Comments
 (0)