Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
6ffe852f
Kaydet (Commit)
6ffe852f
authored
Mar 18, 2009
tarafından
Benjamin Peterson
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
fix strange errors when setting attributes on tracebacks #4034
üst
7c33bd5e
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
22 additions
and
23 deletions
+22
-23
test_traceback.py
Lib/test/test_traceback.py
+0
-8
NEWS
Misc/NEWS
+3
-0
frameobject.c
Objects/frameobject.c
+11
-1
traceback.c
Python/traceback.c
+8
-14
No files found.
Lib/test/test_traceback.py
Dosyayı görüntüle @
6ffe852f
...
...
@@ -111,14 +111,6 @@ def test():
os
.
unlink
(
os
.
path
.
join
(
testdir
,
f
))
os
.
rmdir
(
testdir
)
def
test_members
(
self
):
# Covers Python/structmember.c::listmembers()
try
:
1
/
0
except
:
import
sys
sys
.
exc_traceback
.
__members__
def
test_base_exception
(
self
):
# Test that exceptions derived from BaseException are formatted right
e
=
KeyboardInterrupt
()
...
...
Misc/NEWS
Dosyayı görüntüle @
6ffe852f
...
...
@@ -12,6 +12,9 @@ What's New in Python 2.7 alpha 1
Core and Builtins
-----------------
- Issue #4034: Fix weird attribute error messages of the traceback object. (As a
result traceback.__members__ no longer exists.)
- Issue #4474: PyUnicode_FromWideChar now converts characters outside
the BMP to surrogate pairs, on systems with sizeof(wchar_t) == 4
and sizeof(Py_UNICODE) == 2.
...
...
Objects/frameobject.c
Dosyayı görüntüle @
6ffe852f
...
...
@@ -604,7 +604,17 @@ static PyObject *builtin_object;
int
_PyFrame_Init
()
{
builtin_object
=
PyString_InternFromString
(
"__builtins__"
);
return
(
builtin_object
!=
NULL
);
if
(
builtin_object
==
NULL
)
return
0
;
/*
Traceback objects are not created the normal way (through calling the
type), so PyType_Ready has to be called here.
*/
if
(
PyType_Ready
(
&
PyTraceBack_Type
))
{
Py_DECREF
(
builtin_object
);
return
0
;
}
return
1
;
}
PyFrameObject
*
...
...
Python/traceback.c
Dosyayı görüntüle @
6ffe852f
...
...
@@ -11,20 +11,14 @@
#define OFF(x) offsetof(PyTracebackObject, x)
static
struct
memberlist
tb_memberlist
[]
=
{
{
"tb_next"
,
T_OBJECT
,
OFF
(
tb_next
)},
{
"tb_frame"
,
T_OBJECT
,
OFF
(
tb_frame
)},
{
"tb_lasti"
,
T_INT
,
OFF
(
tb_lasti
)},
{
"tb_lineno"
,
T_INT
,
OFF
(
tb_lineno
)},
static
PyMemberDef
tb_memberlist
[]
=
{
{
"tb_next"
,
T_OBJECT
,
OFF
(
tb_next
)
,
READONLY
},
{
"tb_frame"
,
T_OBJECT
,
OFF
(
tb_frame
)
,
READONLY
},
{
"tb_lasti"
,
T_INT
,
OFF
(
tb_lasti
)
,
READONLY
},
{
"tb_lineno"
,
T_INT
,
OFF
(
tb_lineno
)
,
READONLY
},
{
NULL
}
/* Sentinel */
};
static
PyObject
*
tb_getattr
(
PyTracebackObject
*
tb
,
char
*
name
)
{
return
PyMember_Get
((
char
*
)
tb
,
tb_memberlist
,
name
);
}
static
void
tb_dealloc
(
PyTracebackObject
*
tb
)
{
...
...
@@ -58,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*/
...
...
@@ -80,8 +74,8 @@ PyTypeObject PyTraceBack_Type = {
0
,
/* tp_iter */
0
,
/* tp_iternext */
0
,
/* tp_methods */
0
,
/* tp_members */
0
,
/* tp_getset */
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