Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
ee634a40
Commit
ee634a40
authored
Aug 14, 2007
by
Collin Winter
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Get rid of traceback.c:tb_getattr in favor of marking the members as READONLY.
parent
3a38c913
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
19 deletions
+3
-19
Python/traceback.c
Python/traceback.c
+3
-19
No files found.
Python/traceback.c
View file @
ee634a40
...
...
@@ -19,22 +19,6 @@ static PyMemberDef tb_memberlist[] = {
{
NULL
}
/* Sentinel */
};
/* XXX(nnorwitz): can we get rid of tb_getattr and use tp_members? */
static
PyObject
*
tb_getattr
(
PyTracebackObject
*
tb
,
char
*
name
)
{
int
i
;
for
(
i
=
0
;
tb_memberlist
[
i
].
name
!=
NULL
;
i
++
)
{
if
(
strcmp
(
name
,
tb_memberlist
[
i
].
name
)
==
0
)
return
PyMember_GetOne
((
const
char
*
)
tb
,
tb_memberlist
+
i
);
}
PyErr_Format
(
PyExc_AttributeError
,
"'%.50s' object has no attribute '%.400s'"
,
Py_Type
(
tb
)
->
tp_name
,
name
);
return
NULL
;
}
static
void
tb_dealloc
(
PyTracebackObject
*
tb
)
{
...
...
@@ -68,7 +52,7 @@ PyTypeObject PyTraceBack_Type = {
0
,
(
destructor
)
tb_dealloc
,
/*tp_dealloc*/
0
,
/*tp_print*/
(
getattrfunc
)
tb_getattr
,
/*tp_getattr*/
0
,
/*tp_getattr*/
0
,
/*tp_setattr*/
0
,
/*tp_compare*/
0
,
/*tp_repr*/
...
...
@@ -78,7 +62,7 @@ PyTypeObject PyTraceBack_Type = {
0
,
/* tp_hash */
0
,
/* tp_call */
0
,
/* tp_str */
0
,
/* tp_getattro */
PyObject_GenericGetAttr
,
/* tp_getattro */
0
,
/* tp_setattro */
0
,
/* tp_as_buffer */
Py_TPFLAGS_DEFAULT
|
Py_TPFLAGS_HAVE_GC
,
/* tp_flags */
...
...
@@ -90,7 +74,7 @@ PyTypeObject PyTraceBack_Type = {
0
,
/* tp_iter */
0
,
/* tp_iternext */
0
,
/* tp_methods */
0
,
/* tp_members */
tb_memberlist
,
/* tp_members */
0
,
/* tp_getset */
0
,
/* tp_base */
0
,
/* tp_dict */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment