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
a641def1
Kaydet (Commit)
a641def1
authored
Haz 03, 2015
tarafından
Yury Selivanov
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Sade Fark
Issue 24342: No need to use PyAPI_FUNC for _PyEval_ApplyCoroutineWrapper
(Merge 3.5)
üst
47d5e15e
eb698fe6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
29 deletions
+30
-29
ceval.h
Include/ceval.h
+0
-1
ceval.c
Python/ceval.c
+30
-28
No files found.
Include/ceval.h
Dosyayı görüntüle @
a641def1
...
...
@@ -25,7 +25,6 @@ PyAPI_FUNC(void) PyEval_SetProfile(Py_tracefunc, PyObject *);
PyAPI_FUNC
(
void
)
PyEval_SetTrace
(
Py_tracefunc
,
PyObject
*
);
PyAPI_FUNC
(
void
)
_PyEval_SetCoroutineWrapper
(
PyObject
*
);
PyAPI_FUNC
(
PyObject
*
)
_PyEval_GetCoroutineWrapper
(
void
);
PyAPI_FUNC
(
PyObject
*
)
_PyEval_ApplyCoroutineWrapper
(
PyObject
*
);
#endif
struct
_frame
;
/* Avoid including frameobject.h */
...
...
Python/ceval.c
Dosyayı görüntüle @
a641def1
...
...
@@ -146,6 +146,8 @@ static void format_exc_unbound(PyCodeObject *co, int oparg);
static
PyObject
*
unicode_concatenate
(
PyObject
*
,
PyObject
*
,
PyFrameObject
*
,
unsigned
char
*
);
static
PyObject
*
special_lookup
(
PyObject
*
,
_Py_Identifier
*
);
static
PyObject
*
apply_coroutine_wrapper
(
PyObject
*
);
#define NAME_ERROR_MSG \
"name '%.200s' is not defined"
...
...
@@ -3935,7 +3937,7 @@ _PyEval_EvalCodeWithName(PyObject *_co, PyObject *globals, PyObject *locals,
return
NULL
;
if
(
co
->
co_flags
&
(
CO_COROUTINE
|
CO_ITERABLE_COROUTINE
))
return
_PyEval_ApplyCoroutineW
rapper
(
gen
);
return
apply_coroutine_w
rapper
(
gen
);
return
gen
;
}
...
...
@@ -4401,33 +4403,6 @@ _PyEval_GetCoroutineWrapper(void)
return
tstate
->
coroutine_wrapper
;
}
PyObject
*
_PyEval_ApplyCoroutineWrapper
(
PyObject
*
gen
)
{
PyObject
*
wrapped
;
PyThreadState
*
tstate
=
PyThreadState_GET
();
PyObject
*
wrapper
=
tstate
->
coroutine_wrapper
;
if
(
tstate
->
in_coroutine_wrapper
)
{
assert
(
wrapper
!=
NULL
);
PyErr_Format
(
PyExc_RuntimeError
,
"coroutine wrapper %.150R attempted "
"to recursively wrap %.150R"
,
wrapper
,
gen
);
return
NULL
;
}
if
(
wrapper
==
NULL
)
{
return
gen
;
}
tstate
->
in_coroutine_wrapper
=
1
;
wrapped
=
PyObject_CallFunction
(
wrapper
,
"N"
,
gen
);
tstate
->
in_coroutine_wrapper
=
0
;
return
wrapped
;
}
PyObject
*
PyEval_GetBuiltins
(
void
)
{
...
...
@@ -5257,6 +5232,33 @@ unicode_concatenate(PyObject *v, PyObject *w,
return
res
;
}
static
PyObject
*
apply_coroutine_wrapper
(
PyObject
*
gen
)
{
PyObject
*
wrapped
;
PyThreadState
*
tstate
=
PyThreadState_GET
();
PyObject
*
wrapper
=
tstate
->
coroutine_wrapper
;
if
(
tstate
->
in_coroutine_wrapper
)
{
assert
(
wrapper
!=
NULL
);
PyErr_Format
(
PyExc_RuntimeError
,
"coroutine wrapper %.200R attempted "
"to recursively wrap %.200R"
,
wrapper
,
gen
);
return
NULL
;
}
if
(
wrapper
==
NULL
)
{
return
gen
;
}
tstate
->
in_coroutine_wrapper
=
1
;
wrapped
=
PyObject_CallFunction
(
wrapper
,
"N"
,
gen
);
tstate
->
in_coroutine_wrapper
=
0
;
return
wrapped
;
}
#ifdef DYNAMIC_EXECUTION_PROFILE
static
PyObject
*
...
...
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