diff options
Diffstat (limited to 'lib/python/qmk/c_parse.py')
-rw-r--r-- | lib/python/qmk/c_parse.py | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/lib/python/qmk/c_parse.py b/lib/python/qmk/c_parse.py index 89dd278b7..d4f39c883 100644 --- a/lib/python/qmk/c_parse.py +++ b/lib/python/qmk/c_parse.py | |||
@@ -46,7 +46,7 @@ def find_layouts(file): | |||
46 | parsed_layouts = {} | 46 | parsed_layouts = {} |
47 | 47 | ||
48 | # Search the file for LAYOUT macros and aliases | 48 | # Search the file for LAYOUT macros and aliases |
49 | file_contents = file.read_text() | 49 | file_contents = file.read_text(encoding='utf-8') |
50 | file_contents = comment_remover(file_contents) | 50 | file_contents = comment_remover(file_contents) |
51 | file_contents = file_contents.replace('\\\n', '') | 51 | file_contents = file_contents.replace('\\\n', '') |
52 | 52 | ||
@@ -87,12 +87,7 @@ def find_layouts(file): | |||
87 | except ValueError: | 87 | except ValueError: |
88 | continue | 88 | continue |
89 | 89 | ||
90 | # Populate our aliases | 90 | return parsed_layouts, aliases |
91 | for alias, text in aliases.items(): | ||
92 | if text in parsed_layouts and 'KEYMAP' not in alias: | ||
93 | parsed_layouts[alias] = parsed_layouts[text] | ||
94 | |||
95 | return parsed_layouts | ||
96 | 91 | ||
97 | 92 | ||
98 | def parse_config_h_file(config_h_file, config_h=None): | 93 | def parse_config_h_file(config_h_file, config_h=None): |
@@ -104,7 +99,7 @@ def parse_config_h_file(config_h_file, config_h=None): | |||
104 | config_h_file = Path(config_h_file) | 99 | config_h_file = Path(config_h_file) |
105 | 100 | ||
106 | if config_h_file.exists(): | 101 | if config_h_file.exists(): |
107 | config_h_text = config_h_file.read_text() | 102 | config_h_text = config_h_file.read_text(encoding='utf-8') |
108 | config_h_text = config_h_text.replace('\\\n', '') | 103 | config_h_text = config_h_text.replace('\\\n', '') |
109 | config_h_text = strip_multiline_comment(config_h_text) | 104 | config_h_text = strip_multiline_comment(config_h_text) |
110 | 105 | ||