mirror of
https://github.com/python/cpython.git
synced 2025-11-09 14:06:30 +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;
|
return NULL;
|
||||||
|
|
||||||
if (_dos_findfirst(namebuf, _A_RDONLY |
|
if (_dos_findfirst(namebuf, _A_RDONLY |
|
||||||
_A_HIDDEN | _A_SYSTEM | _A_SUBDIR, &ep) != 0){
|
_A_HIDDEN | _A_SYSTEM | _A_SUBDIR, &ep) != 0)
|
||||||
|
{
|
||||||
errno = ENOENT;
|
errno = ENOENT;
|
||||||
return posix_error();
|
return posix_error();
|
||||||
}
|
}
|
||||||
|
|
@ -876,7 +877,8 @@ posix_execve(self, args)
|
||||||
for (i = 0; i < argc; i++) {
|
for (i = 0; i < argc; i++) {
|
||||||
if (!PyArg_Parse((*getitem)(argv, i),
|
if (!PyArg_Parse((*getitem)(argv, i),
|
||||||
"s;argv must be list of strings",
|
"s;argv must be list of strings",
|
||||||
&argvlist[i])) {
|
&argvlist[i]))
|
||||||
|
{
|
||||||
goto fail_1;
|
goto fail_1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -893,7 +895,8 @@ posix_execve(self, args)
|
||||||
while (PyDict_Next(env, &pos, &key, &val)) {
|
while (PyDict_Next(env, &pos, &key, &val)) {
|
||||||
char *p, *k, *v;
|
char *p, *k, *v;
|
||||||
if (!PyArg_Parse(key, "s;non-string key in env", &k) ||
|
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;
|
goto fail_2;
|
||||||
}
|
}
|
||||||
p = PyMem_NEW(char, PyString_Size(key)+PyString_Size(val) + 2);
|
p = PyMem_NEW(char, PyString_Size(key)+PyString_Size(val) + 2);
|
||||||
|
|
@ -1344,11 +1347,9 @@ posix_open(self, args)
|
||||||
int flag;
|
int flag;
|
||||||
int mode = 0777;
|
int mode = 0777;
|
||||||
int fd;
|
int fd;
|
||||||
if (!PyArg_Parse(args, "(si)", &file, &flag)) {
|
if (!PyArg_ParseTuple(args, "si|i", &file, &flag, &mode))
|
||||||
PyErr_Clear();
|
|
||||||
if (!PyArg_Parse(args, "(sii)", &file, &flag, &mode))
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
|
||||||
Py_BEGIN_ALLOW_THREADS
|
Py_BEGIN_ALLOW_THREADS
|
||||||
fd = open(file, flag, mode);
|
fd = open(file, flag, mode);
|
||||||
Py_END_ALLOW_THREADS
|
Py_END_ALLOW_THREADS
|
||||||
|
|
@ -1514,6 +1515,7 @@ posix_fdopen(self, args)
|
||||||
PyObject *f;
|
PyObject *f;
|
||||||
if (!PyArg_ParseTuple(args, "i|si", &fd, &mode, &bufsize))
|
if (!PyArg_ParseTuple(args, "i|si", &fd, &mode, &bufsize))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
Py_BEGIN_ALLOW_THREADS
|
Py_BEGIN_ALLOW_THREADS
|
||||||
fp = fdopen(fd, mode);
|
fp = fdopen(fd, mode);
|
||||||
Py_END_ALLOW_THREADS
|
Py_END_ALLOW_THREADS
|
||||||
|
|
@ -1730,7 +1732,7 @@ static PyMethodDef posix_methods[] = {
|
||||||
#ifdef HAVE_TCSETPGRP
|
#ifdef HAVE_TCSETPGRP
|
||||||
{"tcsetpgrp", posix_tcsetpgrp},
|
{"tcsetpgrp", posix_tcsetpgrp},
|
||||||
#endif /* HAVE_TCSETPGRP */
|
#endif /* HAVE_TCSETPGRP */
|
||||||
{"open", posix_open},
|
{"open", posix_open, 1},
|
||||||
{"close", posix_close},
|
{"close", posix_close},
|
||||||
{"dup", posix_dup},
|
{"dup", posix_dup},
|
||||||
{"dup2", posix_dup2},
|
{"dup2", posix_dup2},
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue