summaryrefslogtreecommitdiff
path: root/lib/python/qmk/keymap.py
diff options
context:
space:
mode:
authorskullydazed <skullydazed@users.noreply.github.com>2020-04-18 13:00:56 -0700
committerFlorian Didron <fdidron@users.noreply.github.com>2020-06-12 17:00:27 +0900
commit1dfe06affcb723756b038f18efee35f6e30d3802 (patch)
tree7eecd9071877417133762c1e9f873793217a23af /lib/python/qmk/keymap.py
parentd424a716a061bb79335940ea9594c19b4edfa3a1 (diff)
Move everything to Python 3.6 (#8835)
Diffstat (limited to 'lib/python/qmk/keymap.py')
-rw-r--r--lib/python/qmk/keymap.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/python/qmk/keymap.py b/lib/python/qmk/keymap.py
index 4aa87de20d..69cdc8d5b5 100644
--- a/lib/python/qmk/keymap.py
+++ b/lib/python/qmk/keymap.py
@@ -1,6 +1,5 @@
"""Functions that help you work with QMK keymaps.
"""
-import os
from pathlib import Path
import qmk.path
@@ -127,7 +126,7 @@ def list_keymaps(keyboard_name):
while kb_path != keyboards_dir:
keymaps_dir = kb_path / "keymaps"
if keymaps_dir.exists():
- names = names.union([keymap for keymap in os.listdir(str(keymaps_dir)) if (keymaps_dir / keymap / "keymap.c").is_file()])
+ names = names.union([keymap for keymap in keymaps_dir.iterdir() if (keymaps_dir / keymap / "keymap.c").is_file()])
kb_path = kb_path.parent
# if community layouts are supported, get them
@@ -135,6 +134,6 @@ def list_keymaps(keyboard_name):
for layout in rules_mk["LAYOUTS"].split():
cl_path = Path.cwd() / "layouts" / "community" / layout
if cl_path.exists():
- names = names.union([keymap for keymap in os.listdir(str(cl_path)) if (cl_path / keymap / "keymap.c").is_file()])
+ names = names.union([keymap for keymap in cl_path.iterdir() if (cl_path / keymap / "keymap.c").is_file()])
return sorted(names)