Skip to content

Commit 8da7264

Browse files
committed
#4077: No need to append \n when calling Py_FatalError
+ fix a declaration to make it match the one in pythonrun.h
1 parent fea1f82 commit 8da7264

4 files changed

Lines changed: 4 additions & 4 deletions

File tree

Modules/_ctypes/libffi_msvc/ffi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
/* ffi_prep_args is called by the assembly routine once stack space
3535
has been allocated for the function's arguments */
3636

37-
extern void Py_FatalError(char *msg);
37+
extern void Py_FatalError(const char *msg);
3838

3939
/*@-exportheader@*/
4040
void ffi_prep_args(char *stack, extended_cif *ecif)

Objects/exceptions.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2127,7 +2127,7 @@ _PyExc_Init(void)
21272127

21282128
PyExc_MemoryErrorInst = BaseException_new(&_PyExc_MemoryError, NULL, NULL);
21292129
if (!PyExc_MemoryErrorInst)
2130-
Py_FatalError("Cannot pre-allocate MemoryError instance\n");
2130+
Py_FatalError("Cannot pre-allocate MemoryError instance");
21312131

21322132
PyExc_RecursionErrorInst = BaseException_new(&_PyExc_RuntimeError, NULL, NULL);
21332133
if (!PyExc_RecursionErrorInst)

Python/ast.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ num_stmts(const node *n)
197197
default: {
198198
char buf[128];
199199

200-
sprintf(buf, "Non-statement found: %d %d\n",
200+
sprintf(buf, "Non-statement found: %d %d",
201201
TYPE(n), NCH(n));
202202
Py_FatalError(buf);
203203
}

Python/compile.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1254,7 +1254,7 @@ get_ref_type(struct compiler *c, PyObject *name)
12541254
char buf[350];
12551255
PyOS_snprintf(buf, sizeof(buf),
12561256
"unknown scope for %.100s in %.100s(%s) in %s\n"
1257-
"symbols: %s\nlocals: %s\nglobals: %s\n",
1257+
"symbols: %s\nlocals: %s\nglobals: %s",
12581258
PyString_AS_STRING(name),
12591259
PyString_AS_STRING(c->u->u_name),
12601260
PyObject_REPR(c->u->u_ste->ste_id),

0 commit comments

Comments
 (0)