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

Side by Side Diff: Objects/abstract.c

Issue 27095: Simplify MAKE_FUNCTION
Patch Set: Created 3 years, 4 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
OLDNEW
1 /* Abstract Object Interface (many thanks to Jim Fulton) */ 1 /* Abstract Object Interface (many thanks to Jim Fulton) */
2 2
3 #include "Python.h" 3 #include "Python.h"
4 #include <ctype.h> 4 #include <ctype.h>
5 #include "structmember.h" /* we need the offsetof() macro from there */ 5 #include "structmember.h" /* we need the offsetof() macro from there */
6 #include "longintrepr.h" 6 #include "longintrepr.h"
7 7
8 8
9 9
10 /* Shorthands to return certain errors */ 10 /* Shorthands to return certain errors */
(...skipping 2096 matching lines...) Expand 10 before | Expand all | Expand 10 after
2107 if (!err_occurred) { 2107 if (!err_occurred) {
2108 if (func) 2108 if (func)
2109 PyErr_Format(PyExc_SystemError, 2109 PyErr_Format(PyExc_SystemError,
2110 "%R returned NULL without setting an error", 2110 "%R returned NULL without setting an error",
2111 func); 2111 func);
2112 else 2112 else
2113 PyErr_Format(PyExc_SystemError, 2113 PyErr_Format(PyExc_SystemError,
2114 "%s returned NULL without setting an error", 2114 "%s returned NULL without setting an error",
2115 where); 2115 where);
2116 #ifdef Py_DEBUG 2116 #ifdef Py_DEBUG
2117 /* Ensure that the bug is catched in debug mode */ 2117 /* Ensure that the bug is caught in debug mode */
2118 Py_FatalError("a function returned NULL without setting an error"); 2118 Py_FatalError("a function returned NULL without setting an error");
2119 #endif 2119 #endif
2120 return NULL; 2120 return NULL;
2121 } 2121 }
2122 } 2122 }
2123 else { 2123 else {
2124 if (err_occurred) { 2124 if (err_occurred) {
2125 PyObject *exc, *val, *tb; 2125 PyObject *exc, *val, *tb;
2126 PyErr_Fetch(&exc, &val, &tb); 2126 PyErr_Fetch(&exc, &val, &tb);
2127 2127
(...skipping 730 matching lines...) Expand 10 before | Expand all | Expand 10 after
2858 /* Free's a NULL terminated char** array of C strings. */ 2858 /* Free's a NULL terminated char** array of C strings. */
2859 void 2859 void
2860 _Py_FreeCharPArray(char *const array[]) 2860 _Py_FreeCharPArray(char *const array[])
2861 { 2861 {
2862 Py_ssize_t i; 2862 Py_ssize_t i;
2863 for (i = 0; array[i] != NULL; ++i) { 2863 for (i = 0; array[i] != NULL; ++i) {
2864 PyMem_Free(array[i]); 2864 PyMem_Free(array[i]);
2865 } 2865 }
2866 PyMem_Free((void*)array); 2866 PyMem_Free((void*)array);
2867 } 2867 }
OLDNEW

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