Minor formatting changes.

This commit is contained in:
Barry Warsaw 1996-12-19 22:10:44 +00:00
parent 62ac99ebf5
commit 43d68b8fb0

View file

@ -522,7 +522,8 @@ posix_listdir(self, args)
return NULL;
if (_dos_findfirst(namebuf, _A_RDONLY |
_A_HIDDEN | _A_SYSTEM | _A_SUBDIR, &ep) != 0){
_A_HIDDEN | _A_SYSTEM | _A_SUBDIR, &ep) != 0)
{
errno = ENOENT;
return posix_error();
}
@ -876,7 +877,8 @@ posix_execve(self, args)
for (i = 0; i < argc; i++) {
if (!PyArg_Parse((*getitem)(argv, i),
"s;argv must be list of strings",
&argvlist[i])) {
&argvlist[i]))
{
goto fail_1;
}
}
@ -893,7 +895,8 @@ posix_execve(self, args)
while (PyDict_Next(env, &pos, &key, &val)) {
char *p, *k, *v;
if (!PyArg_Parse(key, "s;non-string key in env", &k) ||
!PyArg_Parse(val, "s;non-string value in env", &v)) {
!PyArg_Parse(val, "s;non-string value in env", &v))
{
goto fail_2;
}
p = PyMem_NEW(char, PyString_Size(key)+PyString_Size(val) + 2);
@ -1344,11 +1347,9 @@ posix_open(self, args)
int flag;
int mode = 0777;
int fd;
if (!PyArg_Parse(args, "(si)", &file, &flag)) {
PyErr_Clear();
if (!PyArg_Parse(args, "(sii)", &file, &flag, &mode))
if (!PyArg_ParseTuple(args, "si|i", &file, &flag, &mode))
return NULL;
}
Py_BEGIN_ALLOW_THREADS
fd = open(file, flag, mode);
Py_END_ALLOW_THREADS
@ -1514,6 +1515,7 @@ posix_fdopen(self, args)
PyObject *f;
if (!PyArg_ParseTuple(args, "i|si", &fd, &mode, &bufsize))
return NULL;
Py_BEGIN_ALLOW_THREADS
fp = fdopen(fd, mode);
Py_END_ALLOW_THREADS
@ -1730,7 +1732,7 @@ static PyMethodDef posix_methods[] = {
#ifdef HAVE_TCSETPGRP
{"tcsetpgrp", posix_tcsetpgrp},
#endif /* HAVE_TCSETPGRP */
{"open", posix_open},
{"open", posix_open, 1},
{"close", posix_close},
{"dup", posix_dup},
{"dup2", posix_dup2},