Merge branch 'simplify_code' of https://github.com/Luflosi/kitty

This commit is contained in:
Kovid Goyal 2019-06-11 19:42:59 +05:30
commit 7d385849fb
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -3,6 +3,7 @@
# License: GPLv3 Copyright: 2019, Kovid Goyal <kovid at kovidgoyal.net>
import sys
from contextlib import suppress
from .constants import is_macos
@ -18,11 +19,9 @@ else:
def load_libxkb_lookup():
import ctypes
for suffix in ('.0', ''):
try:
with suppress(Exception):
lib = ctypes.CDLL('libxkbcommon.so' + suffix)
break
except Exception:
pass
else:
from ctypes.util import find_library
lib = find_library('xkbcommon')