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
c7acf2a1
Kaydet (Commit)
c7acf2a1
authored
Şub 27, 1995
tarafından
Guido van Rossum
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
handle class exceptions
üst
cebfa70a
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
25 additions
and
9 deletions
+25
-9
compileall.py
Lib/compileall.py
+4
-1
tb.py
Lib/lib-old/tb.py
+4
-1
tb.py
Lib/tb.py
+4
-1
traceback.py
Lib/traceback.py
+13
-6
No files found.
Lib/compileall.py
Dosyayı görüntüle @
c7acf2a1
...
@@ -30,7 +30,10 @@ def compile_dir(dir, maxlevels = 10):
...
@@ -30,7 +30,10 @@ def compile_dir(dir, maxlevels = 10):
print
'
\n
[interrupt]'
print
'
\n
[interrupt]'
break
break
except
:
except
:
print
'Sorry:'
,
sys
.
exc_type
+
':'
,
if
type
(
sys
.
exc_type
)
==
type
(
''
):
exc_type_name
=
sys
.
exc_type
else
:
exc_type_name
=
sys
.
exc_type
.
__name__
print
'Sorry:'
,
exc_type_name
+
':'
,
print
sys
.
exc_value
print
sys
.
exc_value
elif
maxlevels
>
0
and
\
elif
maxlevels
>
0
and
\
name
!=
os
.
curdir
and
name
!=
os
.
pardir
and
\
name
!=
os
.
curdir
and
name
!=
os
.
pardir
and
\
...
...
Lib/lib-old/tb.py
Dosyayı görüntüle @
c7acf2a1
...
@@ -74,7 +74,10 @@ def browserexec(tb, cmd):
...
@@ -74,7 +74,10 @@ def browserexec(tb, cmd):
exec
(
cmd
+
'
\n
'
,
globals
,
locals
)
exec
(
cmd
+
'
\n
'
,
globals
,
locals
)
except
:
except
:
print
'*** Exception:'
,
print
'*** Exception:'
,
print
sys
.
exc_type
,
if
type
(
sys
.
exc_type
)
==
type
(
''
):
print
sys
.
exc_type
,
else
:
print
sys
.
exc_type
.
__name__
,
if
sys
.
exc_value
<>
None
:
if
sys
.
exc_value
<>
None
:
print
':'
,
sys
.
exc_value
,
print
':'
,
sys
.
exc_value
,
print
print
...
...
Lib/tb.py
Dosyayı görüntüle @
c7acf2a1
...
@@ -74,7 +74,10 @@ def browserexec(tb, cmd):
...
@@ -74,7 +74,10 @@ def browserexec(tb, cmd):
exec
(
cmd
+
'
\n
'
,
globals
,
locals
)
exec
(
cmd
+
'
\n
'
,
globals
,
locals
)
except
:
except
:
print
'*** Exception:'
,
print
'*** Exception:'
,
print
sys
.
exc_type
,
if
type
(
sys
.
exc_type
)
==
type
(
''
):
print
sys
.
exc_type
,
else
:
print
sys
.
exc_type
.
__name__
,
if
sys
.
exc_value
<>
None
:
if
sys
.
exc_value
<>
None
:
print
':'
,
sys
.
exc_value
,
print
':'
,
sys
.
exc_value
,
print
print
...
...
Lib/traceback.py
Dosyayı görüntüle @
c7acf2a1
...
@@ -3,6 +3,7 @@
...
@@ -3,6 +3,7 @@
import
linecache
import
linecache
import
string
import
string
import
sys
import
sys
import
types
def
print_tb
(
tb
,
limit
=
None
):
def
print_tb
(
tb
,
limit
=
None
):
if
limit
is
None
:
if
limit
is
None
:
...
@@ -41,23 +42,29 @@ def extract_tb(tb, limit = None):
...
@@ -41,23 +42,29 @@ def extract_tb(tb, limit = None):
n
=
n
+
1
n
=
n
+
1
return
list
return
list
def
print_exception
(
type
,
value
,
tb
,
limit
=
None
):
def
print_exception
(
e
type
,
value
,
tb
,
limit
=
None
):
if
tb
:
if
tb
:
print
'Traceback (innermost last):'
print
'Traceback (innermost last):'
print_tb
(
tb
,
limit
)
print_tb
(
tb
,
limit
)
if
type
(
etype
)
==
types
.
ClassType
:
stype
=
etype
.
__name__
else
:
stype
=
etype
if
value
is
None
:
if
value
is
None
:
print
type
print
s
type
else
:
else
:
if
type
is
SyntaxError
:
if
e
type
is
SyntaxError
:
try
:
try
:
msg
,
(
filename
,
lineno
,
offset
,
line
)
=
value
msg
,
(
filename
,
lineno
,
offset
,
line
)
=
value
except
:
except
:
pass
pass
else
:
else
:
if
not
filename
:
filename
=
"<string>"
if
not
filename
:
filename
=
"<string>"
print
' File "
%
s", line
%
d'
%
(
filename
,
lineno
)
print
' File "
%
s", line
%
d'
%
\
(
filename
,
lineno
)
i
=
0
i
=
0
while
i
<
len
(
line
)
and
line
[
i
]
in
string
.
whitespace
:
while
i
<
len
(
line
)
and
\
line
[
i
]
in
string
.
whitespace
:
i
=
i
+
1
i
=
i
+
1
s
=
' '
s
=
' '
print
s
+
string
.
strip
(
line
)
print
s
+
string
.
strip
(
line
)
...
@@ -68,7 +75,7 @@ def print_exception(type, value, tb, limit = None):
...
@@ -68,7 +75,7 @@ def print_exception(type, value, tb, limit = None):
s
=
s
+
' '
s
=
s
+
' '
print
s
+
'^'
print
s
+
'^'
value
=
msg
value
=
msg
print
'
%
s:
%
s'
%
(
type
,
value
)
print
'
%
s:
%
s'
%
(
s
type
,
value
)
def
print_exc
(
limit
=
None
):
def
print_exc
(
limit
=
None
):
print_exception
(
sys
.
exc_type
,
sys
.
exc_value
,
sys
.
exc_traceback
,
print_exception
(
sys
.
exc_type
,
sys
.
exc_value
,
sys
.
exc_traceback
,
...
...
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