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>
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.Same change for each branch: rel-v8r0, rel-v9r0, integration (hence
sweep:ignore).BEGINRELEASENOTES
*Core
FIX: annotate DIRAC.exit as NoReturn so pylint knows DIRACExit ends a branch
ENDRELEASENOTES
🤖 Generated with Claude Code