mirror of
https://github.com/kovidgoyal/kitty
synced 2026-06-08 22:28:24 +02:00
Fallback to importlib_resources on python 3.6
This commit is contained in:
@@ -123,7 +123,10 @@ def run_kitten(kitten: str, run_name: str = '__main__') -> None:
|
||||
|
||||
@run_once
|
||||
def all_kitten_names() -> FrozenSet[str]:
|
||||
from importlib.resources import contents
|
||||
try:
|
||||
from importlib.resources import contents
|
||||
except ImportError:
|
||||
from importlib_resources import contents # type: ignore
|
||||
ans = []
|
||||
for name in contents('kittens'):
|
||||
if '__' not in name and '.' not in name and name != 'tui':
|
||||
|
||||
Reference in New Issue
Block a user