Skip to content

Commit 247d10a

Browse files
committed
fix issue #76
1 parent a26a341 commit 247d10a

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

sublime_python_colors.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,19 @@ def generate_color_scheme_async():
8989
for c in d.getchildren():
9090
if c.text and "sublimepythonide" in c.text:
9191
style = style_map.get(c.text)
92+
if style is None:
93+
print("Warning: Unknown SublimePythonIDE color style", c.text)
94+
continue
9295
color_elem = d.find("./dict/string")
96+
if color_elem is None:
97+
print("Warning: Error parsing theme", scheme)
98+
continue
9399
found_color = color_elem.text.upper().lstrip("#")
94-
target_color = colors.get(style, DEFAULT_MARK_COLORS[style]).upper().lstrip("#")
100+
target_color = colors.get(style, DEFAULT_MARK_COLORS[style])
101+
if target_color is None:
102+
print("Warning: Error parsing theme", scheme, "unknown color style: ", style)
103+
continue
104+
target_color = target_color.upper().lstrip("#")
95105
if found_color != target_color:
96106
change = True
97107
color_elem.text = "#" + target_color

0 commit comments

Comments
 (0)