Last active
January 1, 2016 22:19
-
-
Save rgrig/8208981 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff -r e5fa13aae1cc Python/bltinmodule.c | |
--- a/Python/bltinmodule.c Tue Dec 31 06:52:47 2013 -0500 | |
+++ b/Python/bltinmodule.c Wed Jan 01 15:46:01 2014 +0000 | |
@@ -1559,14 +1559,15 @@ | |
equivalent to (x**y) % z, but may be more efficient (e.g. for ints)."); | |
- | |
static PyObject * | |
builtin_print(PyObject *self, PyObject *args, PyObject *kwds) | |
{ | |
+static PyObject *endline = 0; | |
static char *kwlist[] = {"sep", "end", "file", "flush", 0}; | |
static PyObject *dummy_args; | |
PyObject *sep = NULL, *end = NULL, *file = NULL, *flush = NULL; | |
int i, err; | |
+if(!endline) endline=PyUnicode_FromString("\n"); | |
if (dummy_args == NULL && !(dummy_args = PyTuple_New(0))) | |
return NULL; | |
@@ -1621,7 +1623,8 @@ | |
} | |
if (end == NULL) | |
- err = PyFile_WriteString("\n", file); | |
+ //err = PyFile_WriteString("\n", file); | |
+ err = PyFile_WriteObject(endline, file, Py_PRINT_RAW); | |
else | |
err = PyFile_WriteObject(end, file, Py_PRINT_RAW); | |
if (err) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment