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
fcb88c45
Kaydet (Commit)
fcb88c45
authored
Nis 01, 2011
tarafından
Victor Stinner
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #11393: _Py_DumpTraceback() writes the header even if there is no frame
üst
a01ca12a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
10 deletions
+8
-10
traceback.h
Include/traceback.h
+1
-3
traceback.c
Python/traceback.c
+7
-7
No files found.
Include/traceback.h
Dosyayı görüntüle @
fcb88c45
...
@@ -38,8 +38,6 @@ PyAPI_DATA(PyTypeObject) PyTraceBack_Type;
...
@@ -38,8 +38,6 @@ PyAPI_DATA(PyTypeObject) PyTraceBack_Type;
...
...
File "xxx", line xxx in <xxx>
File "xxx", line xxx in <xxx>
Return 0 on success, -1 on error.
This function is written for debug purpose only, to dump the traceback in
This function is written for debug purpose only, to dump the traceback in
the worst case: after a segmentation fault, at fatal error, etc. That's why,
the worst case: after a segmentation fault, at fatal error, etc. That's why,
it is very limited. Strings are truncated to 100 characters and encoded to
it is very limited. Strings are truncated to 100 characters and encoded to
...
@@ -49,7 +47,7 @@ PyAPI_DATA(PyTypeObject) PyTraceBack_Type;
...
@@ -49,7 +47,7 @@ PyAPI_DATA(PyTypeObject) PyTraceBack_Type;
This function is signal safe. */
This function is signal safe. */
PyAPI_DATA
(
int
)
_Py_DumpTraceback
(
PyAPI_DATA
(
void
)
_Py_DumpTraceback
(
int
fd
,
int
fd
,
PyThreadState
*
tstate
);
PyThreadState
*
tstate
);
...
...
Python/traceback.c
Dosyayı görüntüle @
fcb88c45
...
@@ -556,18 +556,19 @@ dump_frame(int fd, PyFrameObject *frame)
...
@@ -556,18 +556,19 @@ dump_frame(int fd, PyFrameObject *frame)
write
(
fd
,
"
\n
"
,
1
);
write
(
fd
,
"
\n
"
,
1
);
}
}
static
int
static
void
dump_traceback
(
int
fd
,
PyThreadState
*
tstate
,
int
write_header
)
dump_traceback
(
int
fd
,
PyThreadState
*
tstate
,
int
write_header
)
{
{
PyFrameObject
*
frame
;
PyFrameObject
*
frame
;
unsigned
int
depth
;
unsigned
int
depth
;
if
(
write_header
)
PUTS
(
fd
,
"Traceback (most recent call first):
\n
"
);
frame
=
_PyThreadState_GetFrame
(
tstate
);
frame
=
_PyThreadState_GetFrame
(
tstate
);
if
(
frame
==
NULL
)
if
(
frame
==
NULL
)
return
-
1
;
return
;
if
(
write_header
)
PUTS
(
fd
,
"Traceback (most recent call first):
\n
"
);
depth
=
0
;
depth
=
0
;
while
(
frame
!=
NULL
)
{
while
(
frame
!=
NULL
)
{
if
(
MAX_FRAME_DEPTH
<=
depth
)
{
if
(
MAX_FRAME_DEPTH
<=
depth
)
{
...
@@ -580,13 +581,12 @@ dump_traceback(int fd, PyThreadState *tstate, int write_header)
...
@@ -580,13 +581,12 @@ dump_traceback(int fd, PyThreadState *tstate, int write_header)
frame
=
frame
->
f_back
;
frame
=
frame
->
f_back
;
depth
++
;
depth
++
;
}
}
return
0
;
}
}
int
void
_Py_DumpTraceback
(
int
fd
,
PyThreadState
*
tstate
)
_Py_DumpTraceback
(
int
fd
,
PyThreadState
*
tstate
)
{
{
return
dump_traceback
(
fd
,
tstate
,
1
);
dump_traceback
(
fd
,
tstate
,
1
);
}
}
/* Write the thread identifier into the file 'fd': "Current thread 0xHHHH:\" if
/* Write the thread identifier into the file 'fd': "Current thread 0xHHHH:\" if
...
...
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