Skip to content

Commit d56178d

Browse files
committed
sigh, old python
1 parent 71d49b5 commit d56178d

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

kittens/runner.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import sys
88
from contextlib import contextmanager
99
from functools import partial
10-
from typing import TYPE_CHECKING, Any, Callable, Dict, FrozenSet, Generator, List, NamedTuple, Optional, cast
10+
from typing import TYPE_CHECKING, Any, Callable, Dict, FrozenSet, Generator, List, NamedTuple, Optional, Union, cast
1111

1212
from kitty.constants import list_kitty_resources
1313
from kitty.types import run_once
@@ -81,7 +81,7 @@ class KittenMetadata(NamedTuple):
8181
has_ready_notification: bool = False
8282
open_url_handler: Optional[Callable[[BossType, WindowType, str, int, str], bool]] = None
8383
allow_remote_control: bool = False
84-
remote_control_password: str | bool = False
84+
remote_control_password: Union[str, bool] = False
8585

8686

8787
def create_kitten_handler(kitten: str, orig_args: List[str]) -> KittenMetadata:

kittens/tui/handler.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,9 @@ def is_click(a: ButtonEvent, b: ButtonEvent) -> bool:
5151

5252
class KittenUI:
5353
allow_remote_control: bool = False
54-
remote_control_password: bool | str = False
54+
remote_control_password: Union[bool, str] = False
5555

56-
def __init__(self, func: Callable[[list[str]], str], allow_remote_control: bool, remote_control_password: bool | str):
56+
def __init__(self, func: Callable[[list[str]], str], allow_remote_control: bool, remote_control_password: Union[bool, str]):
5757
self.func = func
5858
self.allow_remote_control = allow_remote_control
5959
self.remote_control_password = remote_control_password
@@ -94,7 +94,7 @@ def allow_indiscriminate_remote_control(self, enable: bool = True) -> None:
9494
if self.password:
9595
os.environ.pop('KITTY_RC_PASSWORD', None)
9696

97-
def remote_control(self, cmd: str | Sequence[str], **kw: Any) -> Any:
97+
def remote_control(self, cmd: Union[str, Sequence[str]], **kw: Any) -> Any:
9898
if not self.allow_remote_control:
9999
raise ValueError('Remote control is not enabled, remember to use allow_remote_control=True')
100100
prefix = [kitten_exe(), '@']
@@ -132,7 +132,7 @@ def remote_control(self, cmd: str | Sequence[str], **kw: Any) -> Any:
132132

133133
def kitten_ui(
134134
allow_remote_control: bool = KittenUI.allow_remote_control,
135-
remote_control_password: bool | str = KittenUI.allow_remote_control,
135+
remote_control_password: Union[bool, str] = KittenUI.allow_remote_control,
136136
) -> Callable[[Callable[[list[str]], str]], KittenUI]:
137137

138138
def wrapper(impl: Callable[..., Any]) -> KittenUI:

0 commit comments

Comments
 (0)