mirror of
https://github.com/python/cpython.git
synced 2025-07-30 06:34:15 +00:00
Merged revisions 61520,61523-61528,61532 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r61520 | thomas.heller | 2008-03-18 16:03:17 +0100 (Di, 18 Mär 2008) | 5 lines Include <alloca.h> on Solaris, see issue #1506. It would probably be better to have a configure test for that, but this is outside of my configure expertise. ........ r61523 | brett.cannon | 2008-03-18 16:35:58 +0100 (Di, 18 Mär 2008) | 5 lines Remove all traces of HAVE_STRERROR. The removal of strerror.c led to the function check being removed from configure.in. ........ r61524 | brett.cannon | 2008-03-18 16:52:00 +0100 (Di, 18 Mär 2008) | 2 lines Fix test_errno to only check for error numbers that are defined by Standard C. ........ r61525 | steven.bethard | 2008-03-18 17:00:19 +0100 (Di, 18 Mär 2008) | 1 line Use test_support.unlink instead of os.unlink in tearDown(). (Seems to fix an occasional failure in Windows Vista.) ........ r61526 | brett.cannon | 2008-03-18 17:47:51 +0100 (Di, 18 Mär 2008) | 3 lines Cast the arguments to PyString_AsStringAndSize() to silence compiler warnings on OS X. ........ r61527 | sean.reifschneider | 2008-03-18 18:24:12 +0100 (Di, 18 Mär 2008) | 3 lines Issue 1577: shutil.move() where destination is a directory was doing a copy, now it is doing a os.rename() if it's on the same file-system. ........ r61528 | brett.cannon | 2008-03-18 18:25:13 +0100 (Di, 18 Mär 2008) | 12 lines Add Tools/scripts/patchcheck.py. Invoked from ``make check``, the script does some verification: - Runs reindent.py on all .py files. - Checks if any changes in Doc exist. - Whether Misc/ACKS was changed. - Whether Misc/NEWS was changed. The hope is that ``make check`` can become a command anybody can run to get reminders about what all the requisite steps needed to create a proper patch/checkin. ........ r61532 | neal.norwitz | 2008-03-18 18:58:02 +0100 (Di, 18 Mär 2008) | 1 line Get regrtest working when re-running tests ........
This commit is contained in:
parent
430865fe26
commit
ada8c3b046
10 changed files with 243 additions and 93 deletions
|
@ -104,11 +104,7 @@ dircheck(PyFileIOObject* self)
|
|||
if (self->fd < 0)
|
||||
return 0;
|
||||
if (fstat(self->fd, &buf) == 0 && S_ISDIR(buf.st_mode)) {
|
||||
#ifdef HAVE_STRERROR
|
||||
char *msg = strerror(EISDIR);
|
||||
#else
|
||||
char *msg = "Is a directory";
|
||||
#endif
|
||||
PyObject *exc;
|
||||
internal_close(self);
|
||||
|
||||
|
@ -295,12 +291,8 @@ fileio_dealloc(PyFileIOObject *self)
|
|||
if (self->fd >= 0 && self->closefd) {
|
||||
errno = internal_close(self);
|
||||
if (errno < 0) {
|
||||
#ifdef HAVE_STRERROR
|
||||
PySys_WriteStderr("close failed: [Errno %d] %s\n",
|
||||
errno, strerror(errno));
|
||||
#else
|
||||
PySys_WriteStderr("close failed: [Errno %d]\n", errno);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -507,13 +507,9 @@ Py_Main(int argc, char **argv)
|
|||
|
||||
if (sts==-1 && filename!=NULL) {
|
||||
if ((fp = fopen(filename, "r")) == NULL) {
|
||||
#ifdef HAVE_STRERROR
|
||||
fprintf(stderr, "%s: can't open file '%s': [Errno %d] %s\n",
|
||||
argv[0], filename, errno, strerror(errno));
|
||||
#else
|
||||
fprintf(stderr, "%s: can't open file '%s': Errno %d\n",
|
||||
argv[0], filename, errno);
|
||||
#endif
|
||||
|
||||
return 2;
|
||||
}
|
||||
else if (skipfirstline) {
|
||||
|
|
|
@ -5239,7 +5239,6 @@ posix_unsetenv(PyObject *self, PyObject *args)
|
|||
}
|
||||
#endif /* unsetenv */
|
||||
|
||||
#ifdef HAVE_STRERROR
|
||||
PyDoc_STRVAR(posix_strerror__doc__,
|
||||
"strerror(code) -> string\n\n\
|
||||
Translate an error code to a message string.");
|
||||
|
@ -5259,7 +5258,6 @@ posix_strerror(PyObject *self, PyObject *args)
|
|||
}
|
||||
return PyUnicode_FromString(message);
|
||||
}
|
||||
#endif /* strerror */
|
||||
|
||||
|
||||
#ifdef HAVE_SYS_WAIT_H
|
||||
|
@ -6977,9 +6975,7 @@ static PyMethodDef posix_methods[] = {
|
|||
#ifdef HAVE_UNSETENV
|
||||
{"unsetenv", posix_unsetenv, METH_VARARGS, posix_unsetenv__doc__},
|
||||
#endif
|
||||
#ifdef HAVE_STRERROR
|
||||
{"strerror", posix_strerror, METH_VARARGS, posix_strerror__doc__},
|
||||
#endif
|
||||
#ifdef HAVE_FCHDIR
|
||||
{"fchdir", posix_fchdir, METH_O, posix_fchdir__doc__},
|
||||
#endif
|
||||
|
|
|
@ -2922,15 +2922,10 @@ gethost_common(struct hostent *h, struct sockaddr *addr, int alen, int af)
|
|||
}
|
||||
|
||||
if (h->h_addrtype != af) {
|
||||
#ifdef HAVE_STRERROR
|
||||
/* Let's get real error message to return */
|
||||
PyErr_SetString(socket_error,
|
||||
(char *)strerror(EAFNOSUPPORT));
|
||||
#else
|
||||
PyErr_SetString(
|
||||
socket_error,
|
||||
"Address family not supported by protocol family");
|
||||
#endif
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue