Repository navigation
Conversation
astroid 4.3.4 makes pylint report possibly-used-before-assignment in dirac_admin_add_site.py, because a branch that ends in DIRACExit(-1) is not known to terminate. Annotating DIRAC.exit with NoReturn lets pylint treat every DIRACExit call as the end of its branch. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit 183bc60)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
pylint fails on every PR since astroid 4.3.4 reached conda-forge (8 Oct):
DIRAC.exit()(imported asDIRACExit) wrapssys.exitbut is not annotated, so pylint cannot tell that a branch ending inDIRACExit(-1)stops there. astroid 4.3.3 happened to hide this. AnnotatingexitwithNoReturnfixes this call site and every otherDIRACExitcall.Checked in a conda env built from
environment.yml(pylint 4.1.2): the error appears with astroid 4.3.4 and not with 4.3.3 (diracx 0.5.0 vs 0.6.0 makes no difference), andpylint -j 0 -E src/is clean with this change.rel-v8r0 also needs the
no-memberdisables that integration (ccc846a, #8816) and rel-v9r0 (183bc60, #8777) already got: with-j 0, pylint reports a varying subset ofInstance of 'IOLoop' has no 'getDN' memberstyle errors onThreadConfigcalls (5 on 1 Oct, 9 on this PR). This PR cherry-picks 183bc60 and adds the same disable on the two v8.0-onlygetSetup()calls, which the 9.0 commit does not cover. Every line CI reported now has a disable, andpylint -j 0 -E src/was clean twice locally with astroid 4.3.4.The NoReturn change is the same on each branch (#8821 rel-v8r0, #8822 rel-v9r0, #8823 integration); the no-member backport is rel-v8r0 only. Hence
sweep:ignore.BEGINRELEASENOTES
*Core
FIX: annotate DIRAC.exit as NoReturn so pylint knows DIRACExit ends a branch
FIX: backport the pylint no-member disables on ThreadConfig calls
ENDRELEASENOTES
🤖 Generated with Claude Code