From: Amaury Forgeot d'Arc Date: Sat, 17 Jan 2009 20:18:59 +0000 (+0000) Subject: #4077: No need to append \n when calling Py_FatalError X-Git-Tag: v2.7a1~2273 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=59ce042766d95a1471b08241038b8e0f4a65743a;p=thirdparty%2FPython%2Fcpython.git #4077: No need to append \n when calling Py_FatalError + fix a declaration to make it match the one in pythonrun.h --- diff --git a/Modules/_ctypes/libffi_msvc/ffi.c b/Modules/_ctypes/libffi_msvc/ffi.c index e3e2344aa6e1..279b66b473bb 100644 --- a/Modules/_ctypes/libffi_msvc/ffi.c +++ b/Modules/_ctypes/libffi_msvc/ffi.c @@ -34,7 +34,7 @@ /* ffi_prep_args is called by the assembly routine once stack space has been allocated for the function's arguments */ -extern void Py_FatalError(char *msg); +extern void Py_FatalError(const char *msg); /*@-exportheader@*/ void ffi_prep_args(char *stack, extended_cif *ecif) diff --git a/Objects/exceptions.c b/Objects/exceptions.c index eeebb5cb2d34..99cfb2b15d00 100644 --- a/Objects/exceptions.c +++ b/Objects/exceptions.c @@ -2127,7 +2127,7 @@ _PyExc_Init(void) PyExc_MemoryErrorInst = BaseException_new(&_PyExc_MemoryError, NULL, NULL); if (!PyExc_MemoryErrorInst) - Py_FatalError("Cannot pre-allocate MemoryError instance\n"); + Py_FatalError("Cannot pre-allocate MemoryError instance"); PyExc_RecursionErrorInst = BaseException_new(&_PyExc_RuntimeError, NULL, NULL); if (!PyExc_RecursionErrorInst) diff --git a/Python/ast.c b/Python/ast.c index 9e8df8644bd1..5f369b662680 100644 --- a/Python/ast.c +++ b/Python/ast.c @@ -197,7 +197,7 @@ num_stmts(const node *n) default: { char buf[128]; - sprintf(buf, "Non-statement found: %d %d\n", + sprintf(buf, "Non-statement found: %d %d", TYPE(n), NCH(n)); Py_FatalError(buf); } diff --git a/Python/compile.c b/Python/compile.c index 8f0fd8d0433f..44ced73c958f 100644 --- a/Python/compile.c +++ b/Python/compile.c @@ -1254,7 +1254,7 @@ get_ref_type(struct compiler *c, PyObject *name) char buf[350]; PyOS_snprintf(buf, sizeof(buf), "unknown scope for %.100s in %.100s(%s) in %s\n" - "symbols: %s\nlocals: %s\nglobals: %s\n", + "symbols: %s\nlocals: %s\nglobals: %s", PyString_AS_STRING(name), PyString_AS_STRING(c->u->u_name), PyObject_REPR(c->u->u_ste->ste_id),