device: check for existences of keys file before opening

This commit is contained in:
Peter F. Patel-Schneider 2024-04-21 16:32:20 -04:00
parent 4225fce8d7
commit 932bc5cb0e
1 changed files with 9 additions and 8 deletions

View File

@ -1525,6 +1525,7 @@ KEYCODES = _NamedInts(
# load in override dictionary for KEYCODES
try:
if _os.path.isfile(_keys_file_path):
with open(_keys_file_path) as keys_file:
keys = _yaml.safe_load(keys_file)
if isinstance(keys, dict):