Skip to content

Commit ace4df5

Browse files
committed
Avoid usage of pipe symbol in type hints
1 parent c9cf3ca commit ace4df5

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/scyjava/_cjdk_fetch.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import os
55
import shutil
66
import subprocess
7-
from typing import TYPE_CHECKING
7+
from typing import TYPE_CHECKING, Union
88

99
import jpype
1010

@@ -118,7 +118,7 @@ def cjdk_fetch_maven(url: str = "", sha: str = "", raise_on_error: bool = True)
118118
raise RuntimeError("Failed to find Maven executable in the downloaded package.")
119119

120120

121-
def _add_to_path(path: Path | str, front: bool = False) -> None:
121+
def _add_to_path(path: Union[Path, str], front: bool = False) -> None:
122122
"""Add a path to the PATH environment variable.
123123
124124
If front is True, the path is added to the front of the PATH.

src/scyjava/_jvm.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
from functools import lru_cache
1212
from importlib import import_module
1313
from pathlib import Path
14+
from typing import Optional
1415

1516
import jpype
1617
import jpype.config
@@ -106,7 +107,7 @@ def jvm_version() -> str:
106107
return tuple(map(int, m.group(1).split(".")))
107108

108109

109-
def start_jvm(options=None, *, fetch_java: bool | None = None) -> None:
110+
def start_jvm(options=None, *, fetch_java: Optional[bool] = None) -> None:
110111
"""
111112
Explicitly connect to the Java virtual machine (JVM). Only one JVM can
112113
be active; does nothing if the JVM has already been started. Calling

0 commit comments

Comments
 (0)