-
-
Notifications
You must be signed in to change notification settings - Fork 32.2k
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1068,8 +1068,10 @@ gc_enable_impl(PyObject *module) | |
/*[clinic end generated code: output=45a427e9dce9155c input=81ac4940ca579707]*/ | ||
{ | ||
if(_PyRuntime.gc.disabled_threads){ | ||
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 " | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. PEP 7: Add a space between 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) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. PEP 7: Add a space after comma. There was a problem hiding this comment. Choose a reason for hiding this commentThe 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); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This brace looks misaligned. |
||
} | ||
_PyRuntime.gc.enabled = 1; | ||
Py_RETURN_NONE; | ||
|
There was a problem hiding this comment.
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.