[Python-checkins] r68667 - in python/trunk: Modules/_ctypes/libffi_msvc/ffi.c Objects/exceptions.c Python/ast.c Python/compile.c

amaury.forgeotdarc python-checkins at python.org
Sat Jan 17 21:19:00 CET 2009


Author: amaury.forgeotdarc
Date: Sat Jan 17 21:18:59 2009
New Revision: 68667

Log:
#4077: No need to append \n when calling Py_FatalError
+ fix a declaration to make it match the one in pythonrun.h


Modified:
   python/trunk/Modules/_ctypes/libffi_msvc/ffi.c
   python/trunk/Objects/exceptions.c
   python/trunk/Python/ast.c
   python/trunk/Python/compile.c

Modified: python/trunk/Modules/_ctypes/libffi_msvc/ffi.c
==============================================================================
--- python/trunk/Modules/_ctypes/libffi_msvc/ffi.c	(original)
+++ python/trunk/Modules/_ctypes/libffi_msvc/ffi.c	Sat Jan 17 21:18:59 2009
@@ -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)

Modified: python/trunk/Objects/exceptions.c
==============================================================================
--- python/trunk/Objects/exceptions.c	(original)
+++ python/trunk/Objects/exceptions.c	Sat Jan 17 21:18:59 2009
@@ -2127,7 +2127,7 @@
 
     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)

Modified: python/trunk/Python/ast.c
==============================================================================
--- python/trunk/Python/ast.c	(original)
+++ python/trunk/Python/ast.c	Sat Jan 17 21:18:59 2009
@@ -197,7 +197,7 @@
         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);
         }

Modified: python/trunk/Python/compile.c
==============================================================================
--- python/trunk/Python/compile.c	(original)
+++ python/trunk/Python/compile.c	Sat Jan 17 21:18:59 2009
@@ -1254,7 +1254,7 @@
 	    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),


More information about the Python-checkins mailing list