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

Side by Side Diff: Objects/abstract.c

Issue 27095: Simplify MAKE_FUNCTION
Patch Set: Created 3 years, 3 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 2114 matching lines...) Expand 10 before | Expand all | Expand 10 after
2125 if (!err_occurred) { 2125 if (!err_occurred) {
2126 if (func) 2126 if (func)
2127 PyErr_Format(PyExc_SystemError, 2127 PyErr_Format(PyExc_SystemError,
2128 "%R returned NULL without setting an error", 2128 "%R returned NULL without setting an error",
2129 func); 2129 func);
2130 else 2130 else
2131 PyErr_Format(PyExc_SystemError, 2131 PyErr_Format(PyExc_SystemError,
2132 "%s returned NULL without setting an error", 2132 "%s returned NULL without setting an error",
2133 where); 2133 where);
2134 #ifdef Py_DEBUG 2134 #ifdef Py_DEBUG
2135 /* Ensure that the bug is catched in debug mode */ 2135 /* Ensure that the bug is caught in debug mode */
2136 Py_FatalError("a function returned NULL without setting an error"); 2136 Py_FatalError("a function returned NULL without setting an error");
2137 #endif 2137 #endif
2138 return NULL; 2138 return NULL;
2139 } 2139 }
2140 } 2140 }
2141 else { 2141 else {
2142 if (err_occurred) { 2142 if (err_occurred) {
2143 PyObject *exc, *val, *tb; 2143 PyObject *exc, *val, *tb;
2144 PyErr_Fetch(&exc, &val, &tb); 2144 PyErr_Fetch(&exc, &val, &tb);
2145 2145
(...skipping 730 matching lines...) Expand 10 before | Expand all | Expand 10 after
2876 /* Free's a NULL terminated char** array of C strings. */ 2876 /* Free's a NULL terminated char** array of C strings. */
2877 void 2877 void
2878 _Py_FreeCharPArray(char *const array[]) 2878 _Py_FreeCharPArray(char *const array[])
2879 { 2879 {
2880 Py_ssize_t i; 2880 Py_ssize_t i;
2881 for (i = 0; array[i] != NULL; ++i) { 2881 for (i = 0; array[i] != NULL; ++i) {
2882 PyMem_Free(array[i]); 2882 PyMem_Free(array[i]);
2883 } 2883 }
2884 PyMem_Free((void*)array); 2884 PyMem_Free((void*)array);
2885 } 2885 }
OLDNEW
« Doc/library/dis.rst ('K') | « Lib/test/test_grammar.py ('k') | Python/ceval.c » ('j') | no next file with comments »

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