From e5e0eb037302aa50807aa517b6fa9fff482f4ea7 Mon Sep 17 00:00:00 2001 From: Athanasius Date: Mon, 12 Oct 2020 17:06:11 +0100 Subject: [PATCH] EDMarketConnector: Revert to tearoff=tk.FALSE And added `# type: ignore` comments. This is a mess. On the tkinter side it *is* an int, default 0. But enough python stuff has assumed it's a bool for typeshed to define that tearoff should be. It doesn't match, mypy complains. --- EDMarketConnector.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/EDMarketConnector.py b/EDMarketConnector.py index 1ea22601..a2d0a37d 100755 --- a/EDMarketConnector.py +++ b/EDMarketConnector.py @@ -406,17 +406,17 @@ class AppWindow(object): self.w.resizable(tk.FALSE, tk.FALSE) # Can't be only resizable on one axis else: # win32 or linux - self.file_menu = self.view_menu = tk.Menu(self.menubar, tearoff=False) + self.file_menu = self.view_menu = tk.Menu(self.menubar, tearoff=tk.FALSE) # type: ignore self.file_menu.add_command(command=lambda: stats.StatsDialog(self)) self.file_menu.add_command(command=self.save_raw) self.file_menu.add_command(command=lambda: prefs.PreferencesDialog(self.w, self.postprefs)) self.file_menu.add_separator() self.file_menu.add_command(command=self.onexit) self.menubar.add_cascade(menu=self.file_menu) - self.edit_menu = tk.Menu(self.menubar, tearoff=False) + self.edit_menu = tk.Menu(self.menubar, tearoff=tk.FALSE) # type: ignore self.edit_menu.add_command(accelerator='Ctrl+C', state=tk.DISABLED, command=self.copy) self.menubar.add_cascade(menu=self.edit_menu) - self.help_menu = tk.Menu(self.menubar, tearoff=False) + self.help_menu = tk.Menu(self.menubar, tearoff=tk.FALSE) # type: ignore self.help_menu.add_command(command=self.help_general) self.help_menu.add_command(command=self.help_privacy) self.help_menu.add_command(command=self.help_releases) @@ -427,7 +427,7 @@ class AppWindow(object): if platform == 'win32': # Must be added after at least one "real" menu entry self.always_ontop = tk.BooleanVar(value=config.getint('always_ontop')) - self.system_menu = tk.Menu(self.menubar, name='system', tearoff=False) # type: ignore # https://github.com/python/typeshed/issues/4658 # noqa: E501 + self.system_menu = tk.Menu(self.menubar, name='system', tearoff=tk.FALSE) # type: ignore # https://github.com/python/typeshed/issues/4658 # noqa: E501 self.system_menu.add_separator() self.system_menu.add_checkbutton(label=_('Always on top'), variable=self.always_ontop,