mirror of
https://github.com/python/cpython.git
synced 2025-11-03 03:22:27 +00:00
Minor formatting changes.
This commit is contained in:
parent
62ac99ebf5
commit
43d68b8fb0
1 changed files with 33 additions and 31 deletions
|
|
@ -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},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue