FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

GH-90699: fix ref counting of static immortal strings by kumaraditya303 · Pull Request #94850 · python/cpython · GitHub

/ cpython Public
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .c  (2) .rst  (1) All 2 file types selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix reference counting bug in :meth:`bool.__repr__`. Patch by Kumar Aditya.
2 changes: 1 addition & 1 deletion Modules/_io/textio.c
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -2244,7 +2244,7 @@ _textiowrapper_readline(textio *self, Py_ssize_t limit)
Py_CLEAR(chunks);
}
if (line == NULL) {
line = &_Py_STR(empty);
line = Py_NewRef(&_Py_STR(empty));
}

return line;
Expand Down
3 changes: 2 additions & 1 deletion Objects/boolobject.c
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
static PyObject *
bool_repr(PyObject *self)
{
return self == Py_True ? &_Py_ID(True) : &_Py_ID(False);
PyObject *res = self == Py_True ? &_Py_ID(True) : &_Py_ID(False);
return Py_NewRef(res);
}

/* Function to return a bool from a C long */
Expand Down

Back | FazBrowse Home | New Git URL