mirror of
https://github.com/python/cpython.git
synced 2025-07-19 17:25:54 +00:00
Merged revisions 81841 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r81841 | victor.stinner | 2010-06-08 22:46:00 +0200 (mar., 08 juin 2010) | 6 lines sys_pyfile_write() does nothing if file is NULL mywrite() falls back to the C file object if sys_pyfile_write() returns an error. This patch fixes a segfault is Py_FatalError() is called in an early stage of Python initialization. ........
This commit is contained in:
parent
a9230236fa
commit
a01c6b3c9e
1 changed files with 3 additions and 0 deletions
|
@ -1670,6 +1670,9 @@ sys_pyfile_write(const char *text, PyObject *file)
|
|||
PyObject *unicode = NULL, *writer = NULL, *args = NULL, *result = NULL;
|
||||
int err;
|
||||
|
||||
if (file == NULL)
|
||||
return -1;
|
||||
|
||||
unicode = PyUnicode_FromString(text);
|
||||
if (unicode == NULL)
|
||||
goto error;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue