-
-
Notifications
You must be signed in to change notification settings - Fork 32.1k
gh-132171: Fix _interpreters.run_string
crash on string subclass
#132173
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
Thanks @sobolevn for the PR 🌮🎉.. I'm working now to backport this PR to: 3.13. |
…ass (pythonGH-132173) (cherry picked from commit 3980718) Co-authored-by: sobolevn <mail@sobolevn.me>
GH-132219 is a backport of this pull request to the 3.13 branch. |
@@ -330,7 +330,7 @@ get_code_str(PyObject *arg, Py_ssize_t *len_p, PyObject **bytes_p, int *flags_p) | |||
int flags = 0; | |||
|
|||
if (PyUnicode_Check(arg)) { | |||
assert(PyUnicode_CheckExact(arg) | |||
assert(PyUnicode_Check(arg) |
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.
check is already happening in the if condition, then why do the check again? Shouldn't we remove 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.
In hindsight, sure. But I don't think it's worth changing it now; it's not wrong, it's just redundant.
_interpreters.run_string
with a string subclass instance #132171