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
b88db874
Kaydet (Commit)
b88db874
authored
Eyl 07, 2016
tarafından
Benjamin Peterson
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
supress coroutine warning when an exception is pending (#27968)
üst
32d37421
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
12 deletions
+15
-12
genobject.c
Objects/genobject.c
+15
-12
No files found.
Objects/genobject.c
Dosyayı görüntüle @
b88db874
...
@@ -21,7 +21,7 @@ void
...
@@ -21,7 +21,7 @@ void
_PyGen_Finalize
(
PyObject
*
self
)
_PyGen_Finalize
(
PyObject
*
self
)
{
{
PyGenObject
*
gen
=
(
PyGenObject
*
)
self
;
PyGenObject
*
gen
=
(
PyGenObject
*
)
self
;
PyObject
*
res
;
PyObject
*
res
=
NULL
;
PyObject
*
error_type
,
*
error_value
,
*
error_traceback
;
PyObject
*
error_type
,
*
error_value
,
*
error_traceback
;
if
(
gen
->
gi_frame
==
NULL
||
gen
->
gi_frame
->
f_stacktop
==
NULL
)
if
(
gen
->
gi_frame
==
NULL
||
gen
->
gi_frame
->
f_stacktop
==
NULL
)
...
@@ -33,23 +33,26 @@ _PyGen_Finalize(PyObject *self)
...
@@ -33,23 +33,26 @@ _PyGen_Finalize(PyObject *self)
/* If `gen` is a coroutine, and if it was never awaited on,
/* If `gen` is a coroutine, and if it was never awaited on,
issue a RuntimeWarning. */
issue a RuntimeWarning. */
if
(
gen
->
gi_code
!=
NULL
if
(
gen
->
gi_code
!=
NULL
&&
&&
((
PyCodeObject
*
)
gen
->
gi_code
)
->
co_flags
&
CO_COROUTINE
((
PyCodeObject
*
)
gen
->
gi_code
)
->
co_flags
&
CO_COROUTINE
&&
&&
gen
->
gi_frame
->
f_lasti
==
-
1
gen
->
gi_frame
->
f_lasti
==
-
1
)
{
&&
!
PyErr_Occurred
()
if
(
!
error_value
)
{
&&
PyErr_WarnFormat
(
PyExc_RuntimeWarning
,
1
,
PyErr_WarnFormat
(
PyExc_RuntimeWarning
,
1
,
"coroutine '%.50S' was never awaited"
,
"coroutine '%.50S' was never awaited"
,
gen
->
gi_qualname
))
{
gen
->
gi_qualname
);
res
=
NULL
;
/* oops, exception */
}
}
}
else
{
else
{
res
=
gen_close
(
gen
,
NULL
);
res
=
gen_close
(
gen
,
NULL
);
}
}
if
(
res
==
NULL
)
if
(
res
==
NULL
)
{
PyErr_WriteUnraisable
(
self
);
if
(
PyErr_Occurred
())
else
PyErr_WriteUnraisable
(
self
);
}
else
{
Py_DECREF
(
res
);
Py_DECREF
(
res
);
}
/* Restore the saved exception. */
/* Restore the saved exception. */
PyErr_Restore
(
error_type
,
error_value
,
error_traceback
);
PyErr_Restore
(
error_type
,
error_value
,
error_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