bpo-38823: Clean up refleaks in _ast initialization. - #17276
Conversation
corona10
left a comment
There was a problem hiding this comment.
PR looks good to me.
The specific change is that error handling is done by the goto statement
and this decision is looking good to me for this situation.
@vstinner
Please take a look at @brandtbucher 's PR as the core developer.
Thank you for understanding.
There was a problem hiding this comment.
Please add braces, see PEP 7.
| self.emit('if (PyModule_AddObject(m, "AST", astmodulestate_global->AST_type) < 0) goto error;', 1) | |
| self.emit('if (PyModule_AddObject(m, "AST", astmodulestate_global->AST_type) < 0) { goto error; }', 1) |
Same for changes below.
|
@brandtbucher, please address the review comments. Thanks! |
|
Sorry @vstinner, I didn't realize that PEP 7 applied to generated code. Fixed! |
|
I don't see the need to backport such change. Errors in _ast init function are very unlikely. I prefer to reduce the number of backported changes to stable branches to reduce the risk of regression. |

https://bugs.python.org/issue38823