We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent dd44ab9 commit 179869aCopy full SHA for 179869a
Modules/_testcapi/object.c
@@ -76,6 +76,8 @@ pyobject_print_noref_object(PyObject *self, PyObject *args)
76
77
if (PyObject_Print(test_string, fp, 0) < 0){
78
fclose(fp);
79
+ Py_SET_REFCNT(test_string, 1);
80
+ Py_DECREF(test_string);
81
return NULL;
82
}
83
@@ -105,10 +107,12 @@ pyobject_print_os_error(PyObject *self, PyObject *args)
105
107
106
108
if (PyObject_Print(test_string, fp, 0) < 0) {
109
110
111
112
113
114
115
116
117
Py_RETURN_NONE;
118
0 commit comments