Skip to content

[int] Remove asserts from non-test code#8564

Draft
sfayer wants to merge 1 commit into
DIRACGrid:integrationfrom
sfayer:check_assert
Draft

[int] Remove asserts from non-test code#8564
sfayer wants to merge 1 commit into
DIRACGrid:integrationfrom
sfayer:check_assert

Conversation

@sfayer
Copy link
Copy Markdown
Member

@sfayer sfayer commented Jun 2, 2026

Hi,

Part of #8547. This removes all assert usage in non-test code paths as this can misbehave in certain circumstances (as I understand it certain types of packaging that pre-build the byte code can remove asserts as an optimisation). In most cases I've switched it to an AssertionError which will give exactly the same behaviour but won't get optimised out.

Regards,
Simon

BEGINRELEASENOTES
*All
FIX: Remove asserts from non-test code.
ENDRELEASENOTES

Comment thread src/DIRAC/Core/LCG/GOCDBClient.py Outdated
Comment thread src/DIRAC/Core/Utilities/Graphs/PieGraph.py Outdated
Co-authored-by: Federico Stagni <federico.stagni@cern.ch>
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.

2 participants