mirror of
https://github.com/python/cpython.git
synced 2025-09-05 00:11:10 +00:00
Added some additional checks for sys.std?? is None, see #1440
This commit is contained in:
parent
70021d7164
commit
2be03734f8
7 changed files with 17 additions and 12 deletions
|
@ -89,7 +89,7 @@ sys_displayhook(PyObject *self, PyObject *o)
|
|||
if (PyObject_SetAttrString(builtins, "_", Py_None) != 0)
|
||||
return NULL;
|
||||
outf = PySys_GetObject("stdout");
|
||||
if (outf == NULL) {
|
||||
if (outf == NULL || outf == Py_None) {
|
||||
PyErr_SetString(PyExc_RuntimeError, "lost sys.stdout");
|
||||
return NULL;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue