diff options
author | Devaev Maxim <[email protected]> | 2021-01-24 12:46:45 +0300 |
---|---|---|
committer | Devaev Maxim <[email protected]> | 2021-01-24 12:46:45 +0300 |
commit | 428eee4f9785bd1e491d152c49798f2e42d50049 (patch) | |
tree | ece7b23bb67bbc6669297895203072ddde8120c2 /kvmd | |
parent | 573d622a44ffa33dac9c064b2e0d02fca2ee69a9 (diff) |
lint fixes
Diffstat (limited to 'kvmd')
-rw-r--r-- | kvmd/keyboard/keysym.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/kvmd/keyboard/keysym.py b/kvmd/keyboard/keysym.py index a535a5e2..fe425ffe 100644 --- a/kvmd/keyboard/keysym.py +++ b/kvmd/keyboard/keysym.py @@ -22,6 +22,7 @@ import pkgutil import functools +import importlib.machinery from typing import List from typing import Dict @@ -79,8 +80,13 @@ def build_symmap(path: str) -> Dict[int, Dict[int, str]]: @functools.lru_cache() def _get_keysyms() -> Dict[str, int]: keysyms: Dict[str, int] = {} - for (loader, module_name, _) in pkgutil.walk_packages(Xlib.keysymdef.__path__): - module = loader.find_module(module_name).load_module(module_name) + for (finder, module_name, _) in pkgutil.walk_packages(Xlib.keysymdef.__path__): + if not isinstance(finder, importlib.machinery.FileFinder): + continue + loader = finder.find_module(module_name) + if loader is None: + continue + module = loader.load_module(module_name) for keysym_name in dir(module): if keysym_name.startswith("XK_"): short_name = keysym_name[3:] |