mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-28 19:21:38 +02:00
Fix processing of non-string key actions
This commit is contained in:
@@ -7,7 +7,9 @@ import os
|
|||||||
import posixpath
|
import posixpath
|
||||||
from contextlib import suppress
|
from contextlib import suppress
|
||||||
from functools import lru_cache
|
from functools import lru_cache
|
||||||
from typing import Generator, Iterable, List, NamedTuple, Optional, Tuple, cast
|
from typing import (
|
||||||
|
Any, Generator, Iterable, List, NamedTuple, Optional, Tuple, cast
|
||||||
|
)
|
||||||
from urllib.parse import ParseResult, unquote, urlparse
|
from urllib.parse import ParseResult, unquote, urlparse
|
||||||
|
|
||||||
from .conf.utils import to_bool, to_cmdline
|
from .conf.utils import to_bool, to_cmdline
|
||||||
@@ -152,8 +154,10 @@ def actions_for_url_from_list(url: str, actions: Iterable[OpenAction]) -> Genera
|
|||||||
'FRAGMENT': purl.fragment
|
'FRAGMENT': purl.fragment
|
||||||
}
|
}
|
||||||
|
|
||||||
def expand(x: str) -> str:
|
def expand(x: Any) -> Any:
|
||||||
return expandvars(x, env, fallback_to_os_env=False)
|
if isinstance(x, str):
|
||||||
|
return expandvars(x, env, fallback_to_os_env=False)
|
||||||
|
return x
|
||||||
|
|
||||||
for action in actions:
|
for action in actions:
|
||||||
if url_matches_criteria(purl, url, action.match_criteria):
|
if url_matches_criteria(purl, url, action.match_criteria):
|
||||||
|
|||||||
Reference in New Issue
Block a user