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
358e11d9
Kaydet (Commit)
358e11d9
authored
Ock 05, 2011
tarafından
Victor Stinner
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #10756: atexit normalizes the exception before displaying it.
üst
29e762c9
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
0 deletions
+11
-0
test_atexit.py
Lib/test/test_atexit.py
+8
-0
NEWS
Misc/NEWS
+2
-0
atexitmodule.c
Modules/atexitmodule.c
+1
-0
No files found.
Lib/test/test_atexit.py
Dosyayı görüntüle @
358e11d9
...
...
@@ -65,6 +65,14 @@ class TestCase(unittest.TestCase):
self
.
assertRaises
(
TypeError
,
atexit
.
_run_exitfuncs
)
def
test_raise_unnormalized
(
self
):
# Issue #10756: Make sure that an unnormalized exception is
# handled properly
atexit
.
register
(
lambda
:
1
/
0
)
self
.
assertRaises
(
ZeroDivisionError
,
atexit
.
_run_exitfuncs
)
self
.
assertIn
(
"ZeroDivisionError"
,
self
.
stream
.
getvalue
())
def
test_stress
(
self
):
a
=
[
0
]
def
inc
():
...
...
Misc/NEWS
Dosyayı görüntüle @
358e11d9
...
...
@@ -30,6 +30,8 @@ Core and Builtins
Library
-------
- Issue #10756: atexit normalizes the exception before displaying it.
- Issue #10790: email.header.Header.append's charset logic now works correctly
for charsets whose output codec is different from its input codec.
...
...
Modules/atexitmodule.c
Dosyayı görüntüle @
358e11d9
...
...
@@ -72,6 +72,7 @@ atexit_callfuncs(void)
PyErr_Fetch
(
&
exc_type
,
&
exc_value
,
&
exc_tb
);
if
(
!
PyErr_ExceptionMatches
(
PyExc_SystemExit
))
{
PySys_WriteStderr
(
"Error in atexit._run_exitfuncs:
\n
"
);
PyErr_NormalizeException
(
&
exc_type
,
&
exc_value
,
&
exc_tb
);
PyErr_Display
(
exc_type
,
exc_value
,
exc_tb
);
}
}
...
...
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