8000 bpo-31356: Fixing PyErr_WarnEx might error out. by lisroach · Pull Request #5456 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

bpo-31356: Fixing PyErr_WarnEx might error out. #5456

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
8000
Diff view
6 changes: 4 additions & 2 deletions Modules/gcmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -1068,8 +1068,10 @@ gc_enable_impl(PyObject *module)
/*[clinic end generated code: output=45a427e9dce9155c input=81ac4940ca579707]*/
{
if(_PyRuntime.gc.disabled_threads){
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PEP 7: Add a space between the closing parenthesis and the opening brace.

PyErr_WarnEx(PyExc_RuntimeWarning, "Garbage collector enabled while another "
"thread is inside gc.ensure_enabled",1);
if(PyErr_WarnEx(PyExc_RuntimeWarning, "Garbage collector enabled while another "
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PEP 7: Add a space between if and the opening parenthesis. Fix also a line above.

PEP 7: The line is too long (88 columns). It would be better to split it after the first argument.

"thread is inside gc.ensure_enabled",1) == -1) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PEP 7: Add a space after comma.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since the condition is multiline, put the opening brace on a separate line.

PyErr_WriteUnraisable(module);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

return NULL;

}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This brace looks misaligned.

}
_PyRuntime.gc.enabled = 1;
Py_RETURN_NONE;
Expand Down
0