-
-
Notifications
You must be signed in to change notification settings - Fork 34k
bpo-45635: continue refactor of print_exception() to standardize error handling #29996
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
Conversation
…ons to standardize error handling
erlend-aasland
left a comment
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.
Nice! I left some comments :)
Python/pythonrun.c
Outdated
| _Py_static_string(PyId_newline, "\n"); | ||
| PyObject *lines = PyUnicode_Split( | ||
| note, _PyUnicode_FromId(&PyId_newline), -1); |
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.
Completely OT:
- Silly question: Why do we not use
PyUnicode_InternFromStringinstead of_Py_static_string+_PyUnicode_FromIdhere? - If
_PyUnicode_FromIdfails,PyUnicode_Splitwill default to use whitespace as separator. Is that ok? IMO, we should check that the separator object is notNULLbefore proceeding toPyUnicode_Split.
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.
Because I don't know what I'm doing :) (I added this recently, I'll change it).
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.
Actually why not PyUnicode_Splitlines?
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.
Actually why not PyUnicode_Splitlines?
Oh, that's nice :)
Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
erlend-aasland
left a comment
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.
LGTM!
https://bugs.python.org/issue45635