GH-90699: fix ref counting of static immortal strings (gh-94850) · python/cpython@1834133 · GitHub
Skip to content

Commit 1834133

Browse files
GH-90699: fix ref counting of static immortal strings (gh-94850)
1 parent 88e4eeb commit 1834133

3 files changed

Lines changed: 4 additions & 2 deletions

File tree

Lines changed: 1 addition & 0 deletions

Modules/_io/textio.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2244,7 +2244,7 @@ _textiowrapper_readline(textio *self, Py_ssize_t limit)
22442244
Py_CLEAR(chunks);
22452245
}
22462246
if (line == NULL) {
2247-
line = &_Py_STR(empty);
2247+
line = Py_NewRef(&_Py_STR(empty));
22482248
}
22492249

22502250
return line;

Objects/boolobject.c

Lines changed: 2 additions & 1 deletion

0 commit comments

Comments
 (0)