summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@haypocalc.com>2011-03-31 11:40:14 (GMT)
committerVictor Stinner <victor.stinner@haypocalc.com>2011-03-31 11:40:14 (GMT)
commitdd810ddb65870875e0312c04adcf2275ffbd0e17 (patch)
treec9a6284346447475817a96cefe6e064c49be0fc3 /Python
parent05585cbdc828dc47a30237003e80ad7d4699ff95 (diff)
parent27181ac778fdb8432d79f280922eac0f70af5194 (diff)
downloadcpython-dd810ddb65870875e0312c04adcf2275ffbd0e17.zip
cpython-dd810ddb65870875e0312c04adcf2275ffbd0e17.tar.gz
cpython-dd810ddb65870875e0312c04adcf2275ffbd0e17.tar.bz2
Merge 3.2: sys.getfilesystemencoding() raises a RuntimeError if
initfsencoding() was not called yet: detect bootstrap (startup) issues earlier.
Diffstat (limited to 'Python')
-rw-r--r--Python/sysmodule.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/Python/sysmodule.c b/Python/sysmodule.c
index 33255ad..fdf361f 100644
--- a/Python/sysmodule.c
+++ b/Python/sysmodule.c
@@ -259,8 +259,9 @@ sys_getfilesystemencoding(PyObject *self)
{
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,