mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-26 22:45:53 +01:00
[PR #114] conformance/compare.py: import traceback, so an unexpected crash exits 2 and not the mismatch code 1 #165
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
starred/leonida#165
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/ubiquitarianism/leonida/pull/114
Author: @Andretuta
Created: 11/24/2026
Status: 🔄 Open
Base:
main← Head:old-pr/9848📝 Commits (1)
9aece26conformance/compare.py: import traceback, so an unexpected crash exits 2 and not the mismatch code 1📊 Changes
2 files changed (+59 additions, -0 deletions)
View changed files
➕
tests/test_conformance_compare_crash.py(+58 -0)📝
tools/conformance/compare.py(+1 -0)📄 Description
Original description (mentions and
#Nreferences are disabled; the numbers refer to the old repository):Claimed in the coordination issue as: https://github.com/ProjectLeonida/Leonida/issues/9677#issuecomment-7116701113 (new item)
What and why
main()intools/conformance/compare.pycatches any exception a handler did not anticipate and is meant toturn it into exit 2 ("the tool could not run"), never 1 ("the run completed and found a mismatch"). Its except
block calls
traceback.print_exc(), but the module never importstraceback. So the handler itself raisesNameError, which escapesmain(), and Python exits 1. A calling script reads a crash in compare.py asdiffering pixels.
tools/conformance/compare.py:import traceback.tests/test_conformance_compare_crash.py(new, standard library only):command_inspectto raise and checks thatmain()returnsEXIT_ERROR;NameError;#4713made the same one-line change and was closed unmerged together with the rest of the backlog; this onecarries its own test.
Tested
Arch Linux, Python 3.14.10, Node 26.13.1, at
2d53a8055. Neither the change nor its test uses the GPU.mainwithout the fix, the new test fails:NameError: name 'traceback' is not defined, and the scriptexits 1. With the fix it passes, and so do the other
tests/test_conformance_*.py.mainat once (tests/test_ttpf_assets.pyonly; thetwo touch different files), compared with
mainitself:main. The difference is this PR's newtest passing and the
test_ttpf_assetsfix; every other failure is the same file onmain.scripts/run_semantic_tests.py: identical, 6046 tests, the same 2 files failing.node --test: identical, 1 failing;#9823fixes it.compileallandmake_game.py --help: OK.mainhas were already there before this PR.scripts/check_no_game_data.pyand pyflakes on the changed files: clean.AI-assisted: yes (Claude Code, Claude Opus 5.5)
Checklist
docs/design.md, with how it was confirmed. (n/a: no translator change)🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.