summaryrefslogtreecommitdiffstats
path: root/Modules/_posixsubprocess.c
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@haypocalc.com>2010-04-22 12:08:36 (GMT)
committerVictor Stinner <victor.stinner@haypocalc.com>2010-04-22 12:08:36 (GMT)
commitdcb2403022520028a633143602359a30080ed257 (patch)
tree63600ee89e86589546a6e38a65cd453c474a5109 /Modules/_posixsubprocess.c
parentc303c12160090f926d9ffc582a85b82803785e4d (diff)
downloadcpython-dcb2403022520028a633143602359a30080ed257.zip
cpython-dcb2403022520028a633143602359a30080ed257.tar.gz
cpython-dcb2403022520028a633143602359a30080ed257.tar.bz2
Issue #8485: PyUnicode_FSConverter() doesn't accept bytearray object anymore,
you have to convert your bytearray filenames to bytes
Diffstat (limited to 'Modules/_posixsubprocess.c')
-rw-r--r--Modules/_posixsubprocess.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/Modules/_posixsubprocess.c b/Modules/_posixsubprocess.c
index 24a70bc..15c3dc4 100644
--- a/Modules/_posixsubprocess.c
+++ b/Modules/_posixsubprocess.c
@@ -271,10 +271,7 @@ subprocess_fork_exec(PyObject* self, PyObject *args)
if (cwd_obj != Py_None) {
if (PyUnicode_FSConverter(cwd_obj, &cwd_obj2) == 0)
goto cleanup;
- if (PyBytes_Check(cwd_obj2))
- cwd = PyBytes_AS_STRING(cwd_obj2);
- else
- cwd = PyByteArray_AS_STRING(cwd_obj2);
+ cwd = PyBytes_AsString(cwd_obj2);
} else {
cwd = NULL;
cwd_obj2 = NULL;