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
dba1b40b
Kaydet (Commit)
dba1b40b
authored
Nis 02, 2012
tarafından
Benjamin Peterson
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Sade Fark
merge 3.2
üst
38548ad0
e900096d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
0 deletions
+30
-0
test_thread.py
Lib/test/test_thread.py
+24
-0
NEWS
Misc/NEWS
+3
-0
_threadmodule.c
Modules/_threadmodule.c
+3
-0
No files found.
Lib/test/test_thread.py
Dosyayı görüntüle @
dba1b40b
...
...
@@ -128,6 +128,30 @@ class ThreadRunningTests(BasicThreadTest):
time
.
sleep
(
0.01
)
self
.
assertEqual
(
thread
.
_count
(),
orig
)
def
test_save_exception_state_on_error
(
self
):
# See issue #14474
def
task
():
started
.
release
()
sys
.
stderr
=
stderr
raise
SyntaxError
def
mywrite
(
self
,
*
args
):
try
:
raise
ValueError
except
ValueError
:
pass
real_write
(
self
,
*
args
)
c
=
thread
.
_count
()
started
=
thread
.
allocate_lock
()
with
support
.
captured_output
(
"stderr"
)
as
stderr
:
real_write
=
stderr
.
write
stderr
.
write
=
mywrite
started
.
acquire
()
thread
.
start_new_thread
(
task
,
())
started
.
acquire
()
while
thread
.
_count
()
>
c
:
pass
self
.
assertIn
(
"Traceback"
,
stderr
.
getvalue
())
class
Barrier
:
def
__init__
(
self
,
num_threads
):
...
...
Misc/NEWS
Dosyayı görüntüle @
dba1b40b
...
...
@@ -10,6 +10,9 @@ What's New in Python 3.3.0 Alpha 3?
Core and Builtins
-----------------
- Issue #14474: Save and restore exception state in thread.start_new_thread()
while writing error message if the thread leaves a unhandled exception.
- Issue #13019: Fix potential reference leaks in bytearray.extend(). Patch
by Suman Saha.
...
...
Modules/_threadmodule.c
Dosyayı görüntüle @
dba1b40b
...
...
@@ -1001,14 +1001,17 @@ t_bootstrap(void *boot_raw)
PyErr_Clear
();
else
{
PyObject
*
file
;
PyObject
*
exc
,
*
value
,
*
tb
;
PySys_WriteStderr
(
"Unhandled exception in thread started by "
);
PyErr_Fetch
(
&
exc
,
&
value
,
&
tb
);
file
=
PySys_GetObject
(
"stderr"
);
if
(
file
!=
NULL
&&
file
!=
Py_None
)
PyFile_WriteObject
(
boot
->
func
,
file
,
0
);
else
PyObject_Print
(
boot
->
func
,
stderr
,
0
);
PySys_WriteStderr
(
"
\n
"
);
PyErr_Restore
(
exc
,
value
,
tb
);
PyErr_PrintEx
(
0
);
}
}
...
...
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