Fallback to importlib_resources on python 3.6

This commit is contained in:
Kovid Goyal
2021-02-19 18:02:15 +05:30
parent c2a924a5ea
commit dbc1ade5a9
4 changed files with 16 additions and 4 deletions

View File

@@ -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':