Skip to content

Commit

Permalink
myNotebook.py: Make platform check simpler
Browse files Browse the repository at this point in the history
Mypy does not appear to understand the `x in ...` format for this chech
  • Loading branch information
A-UNDERSCORE-D committed Dec 23, 2022
1 parent 5dd2287 commit fa99225
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion myNotebook.py
Expand Up @@ -76,7 +76,8 @@ class Label(tk.Label):
"""Custom tk.Label class to fix some display issues."""

def __init__(self, master: Optional[ttk.Frame] = None, **kw):
if sys.platform in ['darwin', 'win32']:
# This format chosen over `sys.platform in (...)` as mypy and friends dont understand that
if sys.platform == 'darwin' or sys.platform == 'win32':
kw['foreground'] = kw.pop('foreground', PAGEFG)
kw['background'] = kw.pop('background', PAGEBG)
else:
Expand Down

0 comments on commit fa99225

Please sign in to comment.