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
7e8d26d7
Kaydet (Commit)
7e8d26d7
authored
May 22, 1997
tarafından
Guido van Rossum
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
PyFile_WriteString now returns an error indicator instead of calling
PyErr_Clear(). Add checking of those errors.
üst
78a1ed3d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
16 deletions
+32
-16
marshal.c
Python/marshal.c
+2
-2
traceback.c
Python/traceback.c
+30
-14
No files found.
Python/marshal.c
Dosyayı görüntüle @
7e8d26d7
...
@@ -354,11 +354,11 @@ r_long64(p)
...
@@ -354,11 +354,11 @@ r_long64(p)
#else
#else
if
(
r_long
(
p
)
!=
0
)
{
if
(
r_long
(
p
)
!=
0
)
{
PyObject
*
f
=
PySys_GetObject
(
"stderr"
);
PyObject
*
f
=
PySys_GetObject
(
"stderr"
);
PyErr_Clear
();
if
(
f
!=
NULL
)
if
(
f
!=
NULL
)
PyFile_WriteString
(
(
void
)
PyFile_WriteString
(
"Warning: un-marshal 64-bit int in 32-bit mode
\n
"
,
"Warning: un-marshal 64-bit int in 32-bit mode
\n
"
,
f
);
f
);
PyErr_Clear
();
}
}
#endif
#endif
return
x
;
return
x
;
...
...
Python/traceback.c
Dosyayı görüntüle @
7e8d26d7
...
@@ -132,16 +132,19 @@ PyTraceBack_Here(frame)
...
@@ -132,16 +132,19 @@ PyTraceBack_Here(frame)
return
0
;
return
0
;
}
}
static
void
static
int
tb_displayline
(
f
,
filename
,
lineno
,
name
)
tb_displayline
(
f
,
filename
,
lineno
,
name
)
PyObject
*
f
;
PyObject
*
f
;
char
*
filename
;
char
*
filename
;
int
lineno
;
int
lineno
;
char
*
name
;
char
*
name
;
{
{
int
err
=
0
;
FILE
*
xfp
;
FILE
*
xfp
;
char
linebuf
[
1000
];
char
linebuf
[
1000
];
int
i
;
int
i
;
if
(
filename
==
NULL
||
name
==
NULL
)
return
-
1
;
#ifdef MPW
#ifdef MPW
/* This is needed by MPW's File and Line commands */
/* This is needed by MPW's File and Line commands */
#define FMT " File \"%.900s\"; line %d # in %s\n"
#define FMT " File \"%.900s\"; line %d # in %s\n"
...
@@ -165,6 +168,10 @@ tb_displayline(f, filename, lineno, name)
...
@@ -165,6 +168,10 @@ tb_displayline(f, filename, lineno, name)
char
namebuf
[
MAXPATHLEN
+
1
];
char
namebuf
[
MAXPATHLEN
+
1
];
for
(
i
=
0
;
i
<
npath
;
i
++
)
{
for
(
i
=
0
;
i
<
npath
;
i
++
)
{
PyObject
*
v
=
PyList_GetItem
(
path
,
i
);
PyObject
*
v
=
PyList_GetItem
(
path
,
i
);
if
(
v
==
NULL
)
{
PyErr_Clear
();
break
;
}
if
(
PyString_Check
(
v
))
{
if
(
PyString_Check
(
v
))
{
int
len
;
int
len
;
len
=
PyString_Size
(
v
);
len
=
PyString_Size
(
v
);
...
@@ -186,9 +193,9 @@ tb_displayline(f, filename, lineno, name)
...
@@ -186,9 +193,9 @@ tb_displayline(f, filename, lineno, name)
}
}
}
}
sprintf
(
linebuf
,
FMT
,
filename
,
lineno
,
name
);
sprintf
(
linebuf
,
FMT
,
filename
,
lineno
,
name
);
PyFile_WriteString
(
linebuf
,
f
);
err
=
PyFile_WriteString
(
linebuf
,
f
);
if
(
xfp
==
NULL
)
if
(
xfp
==
NULL
||
err
!=
0
)
return
;
return
err
;
for
(
i
=
0
;
i
<
lineno
;
i
++
)
{
for
(
i
=
0
;
i
<
lineno
;
i
++
)
{
if
(
fgets
(
linebuf
,
sizeof
linebuf
,
xfp
)
==
NULL
)
if
(
fgets
(
linebuf
,
sizeof
linebuf
,
xfp
)
==
NULL
)
break
;
break
;
...
@@ -197,32 +204,36 @@ tb_displayline(f, filename, lineno, name)
...
@@ -197,32 +204,36 @@ tb_displayline(f, filename, lineno, name)
char
*
p
=
linebuf
;
char
*
p
=
linebuf
;
while
(
*
p
==
' '
||
*
p
==
'\t'
||
*
p
==
'\014'
)
while
(
*
p
==
' '
||
*
p
==
'\t'
||
*
p
==
'\014'
)
p
++
;
p
++
;
PyFile_WriteString
(
" "
,
f
);
err
=
PyFile_WriteString
(
" "
,
f
);
PyFile_WriteString
(
p
,
f
);
if
(
err
==
0
)
{
if
(
strchr
(
p
,
'\n'
)
==
NULL
)
err
=
PyFile_WriteString
(
p
,
f
);
PyFile_WriteString
(
"
\n
"
,
f
);
if
(
err
==
0
&&
strchr
(
p
,
'\n'
)
==
NULL
)
err
=
PyFile_WriteString
(
"
\n
"
,
f
);
}
}
}
fclose
(
xfp
);
fclose
(
xfp
);
return
err
;
}
}
static
void
static
int
tb_printinternal
(
tb
,
f
,
limit
)
tb_printinternal
(
tb
,
f
,
limit
)
tracebackobject
*
tb
;
tracebackobject
*
tb
;
PyObject
*
f
;
PyObject
*
f
;
int
limit
;
int
limit
;
{
{
int
err
=
0
;
int
depth
=
0
;
int
depth
=
0
;
tracebackobject
*
tb1
=
tb
;
tracebackobject
*
tb1
=
tb
;
while
(
tb1
!=
NULL
)
{
while
(
tb1
!=
NULL
)
{
depth
++
;
depth
++
;
tb1
=
tb1
->
tb_next
;
tb1
=
tb1
->
tb_next
;
}
}
while
(
tb
!=
NULL
&&
!
PyOS_InterruptOccurred
()
)
{
while
(
tb
!=
NULL
&&
err
==
0
)
{
if
(
depth
<=
limit
)
{
if
(
depth
<=
limit
)
{
if
(
Py_OptimizeFlag
)
if
(
Py_OptimizeFlag
)
tb
->
tb_lineno
=
PyCode_Addr2Line
(
tb
->
tb_lineno
=
PyCode_Addr2Line
(
tb
->
tb_frame
->
f_code
,
tb
->
tb_lasti
);
tb
->
tb_frame
->
f_code
,
tb
->
tb_lasti
);
tb_displayline
(
f
,
err
=
tb_displayline
(
f
,
PyString_AsString
(
PyString_AsString
(
tb
->
tb_frame
->
f_code
->
co_filename
),
tb
->
tb_frame
->
f_code
->
co_filename
),
tb
->
tb_lineno
,
tb
->
tb_lineno
,
...
@@ -230,7 +241,10 @@ tb_printinternal(tb, f, limit)
...
@@ -230,7 +241,10 @@ tb_printinternal(tb, f, limit)
}
}
depth
--
;
depth
--
;
tb
=
tb
->
tb_next
;
tb
=
tb
->
tb_next
;
if
(
err
==
0
)
err
=
PyErr_CheckSignals
();
}
}
return
err
;
}
}
int
int
...
@@ -238,6 +252,7 @@ PyTraceBack_Print(v, f)
...
@@ -238,6 +252,7 @@ PyTraceBack_Print(v, f)
PyObject
*
v
;
PyObject
*
v
;
PyObject
*
f
;
PyObject
*
f
;
{
{
int
err
;
PyObject
*
limitv
;
PyObject
*
limitv
;
int
limit
=
1000
;
int
limit
=
1000
;
if
(
v
==
NULL
)
if
(
v
==
NULL
)
...
@@ -252,7 +267,8 @@ PyTraceBack_Print(v, f)
...
@@ -252,7 +267,8 @@ PyTraceBack_Print(v, f)
if
(
limit
<=
0
)
if
(
limit
<=
0
)
return
0
;
return
0
;
}
}
PyFile_WriteString
(
"Traceback (innermost last):
\n
"
,
f
);
err
=
PyFile_WriteString
(
"Traceback (innermost last):
\n
"
,
f
);
tb_printinternal
((
tracebackobject
*
)
v
,
f
,
limit
);
if
(
!
err
)
return
0
;
err
=
tb_printinternal
((
tracebackobject
*
)
v
,
f
,
limit
);
return
err
;
}
}
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