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

Side by Side Diff: Objects/object.c

Issue 28866: Unexpected behavior resulting from mro() and __setattr__ in interactive mode
Patch Set: Created 3 years, 6 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 | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 1
2 /* Generic object operations; and implementation of None */ 2 /* Generic object operations; and implementation of None */
3 3
4 #include "Python.h" 4 #include "Python.h"
5 #include "frameobject.h" 5 #include "frameobject.h"
6 6
7 #ifdef __cplusplus 7 #ifdef __cplusplus
8 extern "C" { 8 extern "C" {
9 #endif 9 #endif
10 10
(...skipping 912 matching lines...) Expand 10 before | Expand all | Expand 10 after
923 PyErr_Format(PyExc_TypeError, 923 PyErr_Format(PyExc_TypeError,
924 "attribute name must be string, not '%.200s'", 924 "attribute name must be string, not '%.200s'",
925 name->ob_type->tp_name); 925 name->ob_type->tp_name);
926 return -1; 926 return -1;
927 } 927 }
928 Py_INCREF(name); 928 Py_INCREF(name);
929 929
930 PyUnicode_InternInPlace(&name); 930 PyUnicode_InternInPlace(&name);
931 if (tp->tp_setattro != NULL) { 931 if (tp->tp_setattro != NULL) {
932 err = (*tp->tp_setattro)(v, name, value); 932 err = (*tp->tp_setattro)(v, name, value);
933 if (PyType_Check(v))
934 PyType_Modified((PyTypeObject*)v);
933 Py_DECREF(name); 935 Py_DECREF(name);
934 return err; 936 return err;
935 } 937 }
936 if (tp->tp_setattr != NULL) { 938 if (tp->tp_setattr != NULL) {
937 char *name_str = PyUnicode_AsUTF8(name); 939 char *name_str = PyUnicode_AsUTF8(name);
938 if (name_str == NULL) 940 if (name_str == NULL)
939 return -1; 941 return -1;
940 err = (*tp->tp_setattr)(v, name_str, value); 942 err = (*tp->tp_setattr)(v, name_str, value);
941 Py_DECREF(name); 943 Py_DECREF(name);
942 return err; 944 return err;
(...skipping 1091 matching lines...) Expand 10 before | Expand all | Expand 10 after
2034 _Py_Dealloc(PyObject *op) 2036 _Py_Dealloc(PyObject *op)
2035 { 2037 {
2036 _Py_INC_TPFREES(op) _Py_COUNT_ALLOCS_COMMA 2038 _Py_INC_TPFREES(op) _Py_COUNT_ALLOCS_COMMA
2037 (*Py_TYPE(op)->tp_dealloc)(op); 2039 (*Py_TYPE(op)->tp_dealloc)(op);
2038 } 2040 }
2039 #endif 2041 #endif
2040 2042
2041 #ifdef __cplusplus 2043 #ifdef __cplusplus
2042 } 2044 }
2043 #endif 2045 #endif
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

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