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
0bbfd832
Kaydet (Commit)
0bbfd832
authored
Tem 24, 2006
tarafından
Tim Peters
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Whitespace normalization.
üst
afb44f47
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
10 deletions
+10
-10
macosxSupport.py
Lib/idlelib/macosxSupport.py
+4
-4
test_traceback.py
Lib/test/test_traceback.py
+2
-2
traceback.py
Lib/traceback.py
+4
-4
No files found.
Lib/idlelib/macosxSupport.py
Dosyayı görüntüle @
0bbfd832
...
...
@@ -30,7 +30,7 @@ def overrideRootMenu(root, flist):
Replace the Tk root menu by something that's more appropriate for
IDLE.
"""
# The menu that is attached to the Tk root (".") is also used by AquaTk for
# The menu that is attached to the Tk root (".") is also used by AquaTk for
# all windows that don't specify a menu of their own. The default menubar
# contains a number of menus, none of which are appropriate for IDLE. The
# Most annoying of those is an 'About Tck/Tk...' menu in the application
...
...
@@ -82,7 +82,7 @@ def overrideRootMenu(root, flist):
for
mname
,
entrylist
in
Bindings
.
menudefs
:
menu
=
menudict
.
get
(
mname
)
if
not
menu
:
if
not
menu
:
continue
for
entry
in
entrylist
:
if
not
entry
:
...
...
@@ -90,14 +90,14 @@ def overrideRootMenu(root, flist):
else
:
label
,
eventname
=
entry
underline
,
label
=
prepstr
(
label
)
accelerator
=
get_accelerator
(
Bindings
.
default_keydefs
,
accelerator
=
get_accelerator
(
Bindings
.
default_keydefs
,
eventname
)
def
command
(
text
=
root
,
eventname
=
eventname
):
text
.
event_generate
(
eventname
)
menu
.
add_command
(
label
=
label
,
underline
=
underline
,
command
=
command
,
accelerator
=
accelerator
)
...
...
Lib/test/test_traceback.py
Dosyayı görüntüle @
0bbfd832
...
...
@@ -112,7 +112,7 @@ def test():
self
.
assertEqual
(
lst
,
[
'KeyboardInterrupt
\n
'
])
# String exceptions are deprecated, but legal. The quirky form with
# separate "type" and "value" tends to break things, because
# separate "type" and "value" tends to break things, because
# not isinstance(value, type)
# and a string cannot be the first argument to issubclass.
#
...
...
@@ -139,7 +139,7 @@ def test():
err
=
traceback
.
format_exception_only
(
str_type
,
str_value
)
self
.
assert_
(
len
(
err
)
==
1
)
self
.
assert_
(
err
[
0
]
==
str_type
+
': '
+
str_value
+
'
\n
'
)
def
test_main
():
run_unittest
(
TracebackCases
)
...
...
Lib/traceback.py
Dosyayı görüntüle @
0bbfd832
...
...
@@ -172,7 +172,7 @@ def format_exception_only(etype, value):
isinstance
(
etype
,
types
.
InstanceType
)
or
type
(
etype
)
is
str
):
return
[
_format_final_exc_line
(
etype
,
value
)]
stype
=
etype
.
__name__
if
not
issubclass
(
etype
,
SyntaxError
):
...
...
@@ -196,18 +196,18 @@ def format_exception_only(etype, value):
# only three spaces to account for offset1 == pos 0
lines
.
append
(
'
%
s^
\n
'
%
''
.
join
(
caretspace
))
value
=
msg
lines
.
append
(
_format_final_exc_line
(
stype
,
value
))
return
lines
def
_format_final_exc_line
(
etype
,
value
):
"""Return a list of a single line -- normal case for format_exception_only"""
if
value
is
None
or
not
str
(
value
):
if
value
is
None
or
not
str
(
value
):
line
=
"
%
s
\n
"
%
etype
else
:
line
=
"
%
s:
%
s
\n
"
%
(
etype
,
_some_str
(
value
))
return
line
def
_some_str
(
value
):
try
:
return
str
(
value
)
...
...
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