Mercurial > cpython-lru_cache-weakref
comparison 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 |
comparison
equal
deleted
inserted
replaced
| 69068:9b12af6e9ea9 | 69077:a00b9a5688da |
|---|---|
| 257 static PyObject * | 257 static PyObject * |
| 258 sys_getfilesystemencoding(PyObject *self) | 258 sys_getfilesystemencoding(PyObject *self) |
| 259 { | 259 { |
| 260 if (Py_FileSystemDefaultEncoding) | 260 if (Py_FileSystemDefaultEncoding) |
| 261 return PyUnicode_FromString(Py_FileSystemDefaultEncoding); | 261 return PyUnicode_FromString(Py_FileSystemDefaultEncoding); |
| 262 Py_INCREF(Py_None); | 262 PyErr_SetString(PyExc_RuntimeError, |
| 263 return Py_None; | 263 "filesystem encoding is not initialized"); |
| 264 return NULL; | |
| 264 } | 265 } |
| 265 | 266 |
| 266 PyDoc_STRVAR(getfilesystemencoding_doc, | 267 PyDoc_STRVAR(getfilesystemencoding_doc, |
| 267 "getfilesystemencoding() -> string\n\ | 268 "getfilesystemencoding() -> string\n\ |
| 268 \n\ | 269 \n\ |
