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
d6473d1a
Kaydet (Commit)
d6473d1a
authored
Mar 01, 2003
tarafından
Guido van Rossum
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Reindent the new code properly.
üst
46d3dc37
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
22 deletions
+22
-22
test_sys.py
Lib/test/test_sys.py
+22
-22
No files found.
Lib/test/test_sys.py
Dosyayı görüntüle @
d6473d1a
...
...
@@ -69,23 +69,23 @@ class SysModuleTest(unittest.TestCase):
# Verify that exc_info is present and matches exc, then clear it, and
# check that it worked.
def
clear_check
(
exc
):
typ
,
value
,
traceback
=
sys
.
exc_info
()
self
.
assert_
(
typ
is
not
None
)
self
.
assert_
(
value
is
exc
)
self
.
assert_
(
traceback
is
not
None
)
typ
,
value
,
traceback
=
sys
.
exc_info
()
self
.
assert_
(
typ
is
not
None
)
self
.
assert_
(
value
is
exc
)
self
.
assert_
(
traceback
is
not
None
)
sys
.
exc_clear
()
sys
.
exc_clear
()
typ
,
value
,
traceback
=
sys
.
exc_info
()
self
.
assert_
(
typ
is
None
)
self
.
assert_
(
value
is
None
)
self
.
assert_
(
traceback
is
None
)
typ
,
value
,
traceback
=
sys
.
exc_info
()
self
.
assert_
(
typ
is
None
)
self
.
assert_
(
value
is
None
)
self
.
assert_
(
traceback
is
None
)
def
clear
():
try
:
raise
ValueError
,
42
except
ValueError
,
exc
:
clear_check
(
exc
)
try
:
raise
ValueError
,
42
except
ValueError
,
exc
:
clear_check
(
exc
)
# Raise an exception and check that it can be cleared
clear
()
...
...
@@ -93,16 +93,16 @@ class SysModuleTest(unittest.TestCase):
# Verify that a frame currently handling an exception is
# unaffected by calling exc_clear in a nested frame.
try
:
raise
ValueError
,
13
raise
ValueError
,
13
except
ValueError
,
exc
:
typ1
,
value1
,
traceback1
=
sys
.
exc_info
()
clear
()
typ2
,
value2
,
traceback2
=
sys
.
exc_info
()
self
.
assert_
(
typ1
is
typ2
)
self
.
assert_
(
value1
is
exc
)
self
.
assert_
(
value1
is
value2
)
self
.
assert_
(
traceback1
is
traceback2
)
typ1
,
value1
,
traceback1
=
sys
.
exc_info
()
clear
()
typ2
,
value2
,
traceback2
=
sys
.
exc_info
()
self
.
assert_
(
typ1
is
typ2
)
self
.
assert_
(
value1
is
exc
)
self
.
assert_
(
value1
is
value2
)
self
.
assert_
(
traceback1
is
traceback2
)
# Check that an exception can be cleared outside of an except block
clear_check
(
exc
)
...
...
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