Mercurial > cpython-lru_cache-weakref
diff Python/sysmodule.c @ 69077:a00b9a5688da 3.2
sys.getfilesystemencoding() raises a RuntimeError if initfsencoding() was not
called yet: detect bootstrap (startup) issues earlier.
| author | Victor Stinner <victor.stinner@haypocalc.com> |
|---|---|
| date | Thu, 31 Mar 2011 13:39:03 +0200 |
| parents | 81d7f78a633a |
| children | 063b4ab49fcc 92212a7b85a3 |
line wrap: on
line diff
--- a/Python/sysmodule.c Thu Mar 31 01:00:32 2011 +0200 +++ b/Python/sysmodule.c Thu Mar 31 13:39:03 2011 +0200 @@ -259,8 +259,9 @@ { if (Py_FileSystemDefaultEncoding) return PyUnicode_FromString(Py_FileSystemDefaultEncoding); - Py_INCREF(Py_None); - return Py_None; + PyErr_SetString(PyExc_RuntimeError, + "filesystem encoding is not initialized"); + return NULL; } PyDoc_STRVAR(getfilesystemencoding_doc,
