Skip to content

Silence pylint E0606 for the conditional ttk import - #222

Open
itzzdev09 wants to merge 1 commit into
netinvent:mainfrom
itzzdev09:pylint-possibly-used-before-assignment
Open

itzzdev09 wants to merge 1 commit into
netinvent:mainfrom
itzzdev09:pylint-possibly-used-before-assignment

Conversation

@itzzdev09

Copy link
Copy Markdown

The pylint-linux-tests and pylint-macos-tests workflows have been failing on main since mid-October (runs on 2026-10-13, 10-16, 10-18 and 11-05) with:

npbackup/gui/ttk_theme.py:129:16: E0606: Possibly using variable 'ttk' before assignment (possibly-used-before-assignment)

ttk is imported conditionally near the top of the module, and change_sg_theme() only uses it when HAVE_TTK_THEME is set. The code already has a # pylint: disable=E0601 (used-before-assignment) comment for this, but newer pylint reports the same situation as E0606 (possibly-used-before-assignment). This adds E0606 to that comment.

I ran pylint 4.1.4 (python:3.13) on a copy of the file with the CI flags (--disable=C,W,R --max-line-length=127) before and after: the E0606 message is reported before and gone after. I did not run the full pylint npbackup command or the GUI.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant