traverse_module_state can in theory return non-zero code:
cpython/Modules/_interpchannelsmodule.c
Lines 283 to 302 in 0d9d489
because PY_VISIT can return it:
cpython/Include/objimpl.h
Lines 193 to 200 in 0d9d489
So, using it like this:
Lines 3627 to 3629 in 0d9d489
Is also not really correct. I will send a PR with the fix.
pythongh-135839: Fix `traverse_module_state` usage in `_interpchannel…
FWIW, I peaked at the git blame, and I didn't find any discussions in the past PRs about wanting to ignore the return value
gh-135839: Fix `module_traverse` and `module_clear` in `_interpchanne…
pythongh-135839: Fix `module_traverse` and `module_clear` in `_interp…
[3.13] pythongh-135839: Fix `module_traverse` and `module_clear` in `…
The same happens in Modules/_interpretersmodule.c, I will check for other usages and create one more PR with the fix of other cases.
[3.14] gh-135839: Fix `module_traverse` and `module_clear` in `_inter…
[3.13] gh-135839: Fix `module_traverse` and `module_clear` in `_inter…
gh-135839: Fix `module_traverse` and `module_clear` in subinterp modu…
pythongh-135839: Fix `module_traverse` and `module_clear` in subinter…
[3.14] gh-135839: Fix `module_traverse` and `module_clear` in subinte…
[3.13] pythongh-135839: Fix `module_traverse` and `module_clear` in s…
[3.13] gh-135839: Fix `module_traverse` and `module_clear` in subinte…
Activity
pythongh-135839: Fix `traverse_module_state` usage in `_interpchannel…
brianschubert commented on Jun 23, 2025
FWIW, I peaked at the git blame, and I didn't find any discussions in the past PRs about wanting to ignore the return value
gh-135839: Fix `module_traverse` and `module_clear` in `_interpchanne…
pythongh-135839: Fix `module_traverse` and `module_clear` in `_interp…
[3.13] pythongh-135839: Fix `module_traverse` and `module_clear` in `…
[3.13] pythongh-135839: Fix `module_traverse` and `module_clear` in `…
sobolevn commented on Jun 25, 2025
The same happens in Modules/_interpretersmodule.c, I will check for other usages and create one more PR with the fix of other cases.
[3.14] gh-135839: Fix `module_traverse` and `module_clear` in `_inter…
[3.13] gh-135839: Fix `module_traverse` and `module_clear` in `_inter…
1 remaining item
gh-135839: Fix `module_traverse` and `module_clear` in subinterp modu…
pythongh-135839: Fix `module_traverse` and `module_clear` in subinter…
[3.14] gh-135839: Fix `module_traverse` and `module_clear` in subinte…
[3.13] pythongh-135839: Fix `module_traverse` and `module_clear` in s…
pythongh-135839: Fix `module_traverse` and `module_clear` in `_interp…
pythongh-135839: Fix `module_traverse` and `module_clear` in subinter…
pythongh-135839: Fix `module_traverse` and `module_clear` in `_interp…
pythongh-135839: Fix `module_traverse` and `module_clear` in subinter…
[3.13] gh-135839: Fix `module_traverse` and `module_clear` in subinte…
pythongh-135839: Fix `module_traverse` and `module_clear` in `_interp…
pythongh-135839: Fix `module_traverse` and `module_clear` in subinter…
pythongh-135839: Fix `module_traverse` and `module_clear` in `_interp…
pythongh-135839: Fix `module_traverse` and `module_clear` in subinter…