Skip to content
Snippets Groups Projects

Do not use AssertionError for control flow

Merged Rosen Matev requested to merge rm-dont-catch-AssertionError into master

When running in optimized mode, asserts are a noop (https://docs.python.org/3/reference/simple_stmts.html#the-assert-statement). We don't use optimized mode in the nightlies, but apparently it happens on the GRID (where the PYTHONOPTIMIZE environment variable is set), and since except AssertionError was used in one place for control flow, that lead to a different behaviour on the GRID.

tl;dr do not catch asserts in Python

Merge request reports

Pipeline #2504646 passed

Pipeline passed for 68ffc700 on rm-dont-catch-AssertionError

Approval is optional

Merged by Rosen MatevRosen Matev 3 years ago (Apr 19, 2021 8:51pm UTC)

Merge details

  • Changes merged into with d15c95a3.
  • Deleted the source branch.

Pipeline #2511348 passed

Pipeline passed for d15c95a3 on master

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
Please register or sign in to reply
Loading