diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c --- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c @@ -6446,21 +6446,21 @@ posix_pathconf(PyObject *self, PyObject if (PyArg_ParseTuple(args, "O&O&:pathconf", PyUnicode_FSConverter, &opath, conv_path_confname, &name)) { - long limit; - - path = PyBytes_AS_STRING(opath); - errno = 0; - limit = pathconf(path, name); - if (limit == -1 && errno != 0) { - if (errno == EINVAL) - /* could be a path or name problem */ - posix_error(); + long limit; + + path = PyBytes_AS_STRING(opath); + errno = 0; + limit = pathconf(path, name); + if (limit == -1 && errno != 0) { + if (errno == EINVAL) + /* could be a path or name problem */ + posix_error(); + else + posix_error_with_filename(path); + } else - posix_error_with_filename(path); - } - else - result = PyLong_FromLong(limit); - Py_DECREF(opath); + result = PyLong_FromLong(limit); + Py_DECREF(opath); } return result; }