summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@haypocalc.com>2010-04-30 00:22:08 (GMT)
committerVictor Stinner <victor.stinner@haypocalc.com>2010-04-30 00:22:08 (GMT)
commit0ea2a468e31b3ec20ae4281d9c28d1f5db7912d9 (patch)
tree1f790a1882eafc1d538a1d72680df20e2f40ef81
parent8130290d420fb7839da4dd5341e5eac960fd7560 (diff)
downloadcpython-0ea2a468e31b3ec20ae4281d9c28d1f5db7912d9.zip
cpython-0ea2a468e31b3ec20ae4281d9c28d1f5db7912d9.tar.gz
cpython-0ea2a468e31b3ec20ae4281d9c28d1f5db7912d9.tar.bz2
Simplify PyUnicode_FSConverter(): remove reference to PyByteArray
PyByteArray is no more supported
-rw-r--r--Objects/unicodeobject.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c
index 3851008..369306e 100644
--- a/Objects/unicodeobject.c
+++ b/Objects/unicodeobject.c
@@ -1638,7 +1638,7 @@ PyUnicode_FSConverter(PyObject* arg, void* addr)
arg = PyUnicode_FromObject(arg);
if (!arg)
return 0;
- output = PyUnicode_AsEncodedObject(arg,
+ output = PyUnicode_AsEncodedObject(arg,
Py_FileSystemDefaultEncoding,
"surrogateescape");
Py_DECREF(arg);
@@ -1650,14 +1650,8 @@ PyUnicode_FSConverter(PyObject* arg, void* addr)
return 0;
}
}
- if (PyBytes_Check(output)) {
- size = PyBytes_GET_SIZE(output);
- data = PyBytes_AS_STRING(output);
- }
- else {
- size = PyByteArray_GET_SIZE(output);
- data = PyByteArray_AS_STRING(output);
- }
+ size = PyBytes_GET_SIZE(output);
+ data = PyBytes_AS_STRING(output);
if (size != strlen(data)) {
PyErr_SetString(PyExc_TypeError, "embedded NUL character");
Py_DECREF(output);