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
a13131cf
Kaydet (Commit)
a13131cf
authored
Nis 15, 2006
tarafından
Tim Peters
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Trimmed trailing whitespace.
üst
9d2ced8f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
13 deletions
+12
-13
frameobject.c
Objects/frameobject.c
+12
-13
No files found.
Objects/frameobject.c
Dosyayı görüntüle @
a13131cf
/* Frame object implementation */
/* Frame object implementation */
#include "Python.h"
#include "Python.h"
...
@@ -333,7 +332,7 @@ frame_settrace(PyFrameObject *f, PyObject* v, void *closure)
...
@@ -333,7 +332,7 @@ frame_settrace(PyFrameObject *f, PyObject* v, void *closure)
Py_XINCREF
(
v
);
Py_XINCREF
(
v
);
f
->
f_trace
=
v
;
f
->
f_trace
=
v
;
if
(
v
!=
NULL
)
if
(
v
!=
NULL
)
f
->
f_lineno
=
PyCode_Addr2Line
(
f
->
f_code
,
f
->
f_lasti
);
f
->
f_lineno
=
PyCode_Addr2Line
(
f
->
f_code
,
f
->
f_lasti
);
...
@@ -399,7 +398,7 @@ frame_dealloc(PyFrameObject *f)
...
@@ -399,7 +398,7 @@ frame_dealloc(PyFrameObject *f)
for
(
p
=
f
->
f_valuestack
;
p
<
f
->
f_stacktop
;
p
++
)
for
(
p
=
f
->
f_valuestack
;
p
<
f
->
f_stacktop
;
p
++
)
Py_XDECREF
(
*
p
);
Py_XDECREF
(
*
p
);
}
}
Py_XDECREF
(
f
->
f_back
);
Py_XDECREF
(
f
->
f_back
);
Py_DECREF
(
f
->
f_code
);
Py_DECREF
(
f
->
f_code
);
Py_DECREF
(
f
->
f_builtins
);
Py_DECREF
(
f
->
f_builtins
);
...
@@ -459,7 +458,7 @@ frame_clear(PyFrameObject *f)
...
@@ -459,7 +458,7 @@ frame_clear(PyFrameObject *f)
oldtop
=
f
->
f_stacktop
;
oldtop
=
f
->
f_stacktop
;
/* Before anything else, make sure that this frame is clearly marked
/* Before anything else, make sure that this frame is clearly marked
as being defunct! */
as being defunct! */
f
->
f_stacktop
=
NULL
;
f
->
f_stacktop
=
NULL
;
...
@@ -536,7 +535,7 @@ int _PyFrame_Init()
...
@@ -536,7 +535,7 @@ int _PyFrame_Init()
}
}
PyFrameObject
*
PyFrameObject
*
PyFrame_New
(
PyThreadState
*
tstate
,
PyCodeObject
*
code
,
PyObject
*
globals
,
PyFrame_New
(
PyThreadState
*
tstate
,
PyCodeObject
*
code
,
PyObject
*
globals
,
PyObject
*
locals
)
PyObject
*
locals
)
{
{
PyFrameObject
*
back
=
tstate
->
frame
;
PyFrameObject
*
back
=
tstate
->
frame
;
...
@@ -565,10 +564,10 @@ PyFrame_New(PyThreadState *tstate, PyCodeObject *code, PyObject *globals,
...
@@ -565,10 +564,10 @@ PyFrame_New(PyThreadState *tstate, PyCodeObject *code, PyObject *globals,
builtins
=
NULL
;
builtins
=
NULL
;
}
}
if
(
builtins
==
NULL
)
{
if
(
builtins
==
NULL
)
{
/* No builtins! Make up a minimal one
/* No builtins! Make up a minimal one
Give them 'None', at least. */
Give them 'None', at least. */
builtins
=
PyDict_New
();
builtins
=
PyDict_New
();
if
(
builtins
==
NULL
||
if
(
builtins
==
NULL
||
PyDict_SetItemString
(
PyDict_SetItemString
(
builtins
,
"None"
,
Py_None
)
<
0
)
builtins
,
"None"
,
Py_None
)
<
0
)
return
NULL
;
return
NULL
;
...
@@ -613,7 +612,7 @@ PyFrame_New(PyThreadState *tstate, PyCodeObject *code, PyObject *globals,
...
@@ -613,7 +612,7 @@ PyFrame_New(PyThreadState *tstate, PyCodeObject *code, PyObject *globals,
Py_INCREF
(
globals
);
Py_INCREF
(
globals
);
f
->
f_globals
=
globals
;
f
->
f_globals
=
globals
;
/* Most functions have CO_NEWLOCALS and CO_OPTIMIZED set. */
/* Most functions have CO_NEWLOCALS and CO_OPTIMIZED set. */
if
((
code
->
co_flags
&
(
CO_NEWLOCALS
|
CO_OPTIMIZED
))
==
if
((
code
->
co_flags
&
(
CO_NEWLOCALS
|
CO_OPTIMIZED
))
==
(
CO_NEWLOCALS
|
CO_OPTIMIZED
))
(
CO_NEWLOCALS
|
CO_OPTIMIZED
))
locals
=
NULL
;
/* PyFrame_FastToLocals() will set. */
locals
=
NULL
;
/* PyFrame_FastToLocals() will set. */
else
if
(
code
->
co_flags
&
CO_NEWLOCALS
)
{
else
if
(
code
->
co_flags
&
CO_NEWLOCALS
)
{
...
@@ -761,10 +760,10 @@ PyFrame_FastToLocals(PyFrameObject *f)
...
@@ -761,10 +760,10 @@ PyFrame_FastToLocals(PyFrameObject *f)
&&
PyTuple_Check
(
f
->
f_code
->
co_freevars
)))
{
&&
PyTuple_Check
(
f
->
f_code
->
co_freevars
)))
{
return
;
return
;
}
}
map_to_dict
(
f
->
f_code
->
co_cellvars
,
map_to_dict
(
f
->
f_code
->
co_cellvars
,
PyTuple_GET_SIZE
(
f
->
f_code
->
co_cellvars
),
PyTuple_GET_SIZE
(
f
->
f_code
->
co_cellvars
),
locals
,
fast
+
f
->
f_nlocals
,
1
);
locals
,
fast
+
f
->
f_nlocals
,
1
);
map_to_dict
(
f
->
f_code
->
co_freevars
,
map_to_dict
(
f
->
f_code
->
co_freevars
,
PyTuple_GET_SIZE
(
f
->
f_code
->
co_freevars
),
PyTuple_GET_SIZE
(
f
->
f_code
->
co_freevars
),
locals
,
fast
+
f
->
f_nlocals
+
f
->
f_ncells
,
1
);
locals
,
fast
+
f
->
f_nlocals
+
f
->
f_ncells
,
1
);
}
}
...
@@ -798,12 +797,12 @@ PyFrame_LocalsToFast(PyFrameObject *f, int clear)
...
@@ -798,12 +797,12 @@ PyFrame_LocalsToFast(PyFrameObject *f, int clear)
if
(
!
(
PyTuple_Check
(
f
->
f_code
->
co_cellvars
)
if
(
!
(
PyTuple_Check
(
f
->
f_code
->
co_cellvars
)
&&
PyTuple_Check
(
f
->
f_code
->
co_freevars
)))
&&
PyTuple_Check
(
f
->
f_code
->
co_freevars
)))
return
;
return
;
dict_to_map
(
f
->
f_code
->
co_cellvars
,
dict_to_map
(
f
->
f_code
->
co_cellvars
,
PyTuple_GET_SIZE
(
f
->
f_code
->
co_cellvars
),
PyTuple_GET_SIZE
(
f
->
f_code
->
co_cellvars
),
locals
,
fast
+
f
->
f_nlocals
,
1
,
clear
);
locals
,
fast
+
f
->
f_nlocals
,
1
,
clear
);
dict_to_map
(
f
->
f_code
->
co_freevars
,
dict_to_map
(
f
->
f_code
->
co_freevars
,
PyTuple_GET_SIZE
(
f
->
f_code
->
co_freevars
),
PyTuple_GET_SIZE
(
f
->
f_code
->
co_freevars
),
locals
,
fast
+
f
->
f_nlocals
+
f
->
f_ncells
,
1
,
locals
,
fast
+
f
->
f_nlocals
+
f
->
f_ncells
,
1
,
clear
);
clear
);
}
}
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