Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(185311)

Side by Side Diff: Objects/fileobject.c

Issue 27809: _PyObject_FastCall(): add support for keyword arguments
Patch Set: Created 2 years, 11 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Objects/abstract.c ('k') | Objects/iterobject.c » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* File object implementation (what's left of it -- see io.py) */ 1 /* File object implementation (what's left of it -- see io.py) */
2 2
3 #define PY_SSIZE_T_CLEAN 3 #define PY_SSIZE_T_CLEAN
4 #include "Python.h" 4 #include "Python.h"
5 5
6 #ifdef HAVE_GETC_UNLOCKED 6 #ifdef HAVE_GETC_UNLOCKED
7 #define GETC(f) getc_unlocked(f) 7 #define GETC(f) getc_unlocked(f)
8 #define FLOCKFILE(f) flockfile(f) 8 #define FLOCKFILE(f) flockfile(f)
9 #define FUNLOCKFILE(f) funlockfile(f) 9 #define FUNLOCKFILE(f) funlockfile(f)
10 #else 10 #else
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 return -1; 139 return -1;
140 if (flags & Py_PRINT_RAW) { 140 if (flags & Py_PRINT_RAW) {
141 value = PyObject_Str(v); 141 value = PyObject_Str(v);
142 } 142 }
143 else 143 else
144 value = PyObject_Repr(v); 144 value = PyObject_Repr(v);
145 if (value == NULL) { 145 if (value == NULL) {
146 Py_DECREF(writer); 146 Py_DECREF(writer);
147 return -1; 147 return -1;
148 } 148 }
149 result = _PyObject_FastCall(writer, &value, 1, NULL); 149 result = _PyObject_CallArg1(writer, value);
150 Py_DECREF(value); 150 Py_DECREF(value);
151 Py_DECREF(writer); 151 Py_DECREF(writer);
152 if (result == NULL) 152 if (result == NULL)
153 return -1; 153 return -1;
154 Py_DECREF(result); 154 Py_DECREF(result);
155 return 0; 155 return 0;
156 } 156 }
157 157
158 int 158 int
159 PyFile_WriteString(const char *s, PyObject *f) 159 PyFile_WriteString(const char *s, PyObject *f)
(...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after
521 stdprinter_init, /* tp_init */ 521 stdprinter_init, /* tp_init */
522 PyType_GenericAlloc, /* tp_alloc */ 522 PyType_GenericAlloc, /* tp_alloc */
523 stdprinter_new, /* tp_new */ 523 stdprinter_new, /* tp_new */
524 PyObject_Del, /* tp_free */ 524 PyObject_Del, /* tp_free */
525 }; 525 };
526 526
527 527
528 #ifdef __cplusplus 528 #ifdef __cplusplus
529 } 529 }
530 #endif 530 #endif
OLDNEW
« no previous file with comments | « Objects/abstract.c ('k') | Objects/iterobject.c » ('j') | no next file with comments »

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+