File tree Expand file tree Collapse file tree 2 files changed +9
-4
lines changed
Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Original file line number Diff line number Diff line change 11# The MIT License
22#
33# Copyright (c) 2009-2015 the bpython authors.
4- # Copyright (c) 2015-2020 Sebastian Ramacher
4+ # Copyright (c) 2015-2022 Sebastian Ramacher
55#
66# Permission is hereby granted, free of charge, to any person obtaining a copy
77# of this software and associated documentation files (the "Software"), to deal
3535from xdg import BaseDirectory
3636
3737from .autocomplete import AutocompleteModes
38- from .curtsiesfrontend .parse import CNAMES
3938
4039default_completion = AutocompleteModes .SIMPLE
40+ # All supported letters for colors for themes
41+ #
42+ # Instead of importing it from .curtsiesfrontend.parse, we define them here to
43+ # avoid a potential import of fcntl on Windows.
44+ COLOR_LETTERS = tuple ("krgybmcwd" )
4145
4246
4347class UnknownColorCode (Exception ):
@@ -381,7 +385,7 @@ def load_theme(
381385 colors [k ] = theme .get ("syntax" , k )
382386 else :
383387 colors [k ] = theme .get ("interface" , k )
384- if colors [k ].lower () not in CNAMES :
388+ if colors [k ].lower () not in COLOR_LETTERS :
385389 raise UnknownColorCode (k , colors [k ])
386390
387391 # Check against default theme to see if all values are defined
Original file line number Diff line number Diff line change 88)
99from functools import partial
1010
11+ from ..config import COLOR_LETTERS
1112from ..lazyre import LazyReCompile
1213
1314
1415COLORS = CURTSIES_COLORS + ("default" ,)
15- CNAMES = dict (zip ("krgybmcwd" , COLORS ))
16+ CNAMES = dict (zip (COLOR_LETTERS , COLORS ))
1617# hack for finding the "inverse"
1718INVERSE_COLORS = {
1819 CURTSIES_COLORS [idx ]: CURTSIES_COLORS [
You can’t perform that action at this time.
0 commit comments