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
b46a633e
Kaydet (Commit)
b46a633e
authored
Kas 04, 2008
tarafından
Hirokazu Yamamoto
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Sorry, r67092 is commit miss....
üst
1543a22d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
21 deletions
+8
-21
pickle.py
Lib/pickle.py
+0
-13
_pickle.c
Modules/_pickle.c
+8
-8
No files found.
Lib/pickle.py
Dosyayı görüntüle @
b46a633e
...
@@ -345,9 +345,6 @@ class _Pickler:
...
@@ -345,9 +345,6 @@ class _Pickler:
else
:
else
:
self
.
write
(
PERSID
+
str
(
pid
)
.
encode
(
"ascii"
)
+
b
'
\n
'
)
self
.
write
(
PERSID
+
str
(
pid
)
.
encode
(
"ascii"
)
+
b
'
\n
'
)
def
_isiter
(
self
,
obj
):
return
hasattr
(
obj
,
'__next__'
)
and
hasattr
(
obj
,
'__iter__'
)
def
save_reduce
(
self
,
func
,
args
,
state
=
None
,
def
save_reduce
(
self
,
func
,
args
,
state
=
None
,
listitems
=
None
,
dictitems
=
None
,
obj
=
None
):
listitems
=
None
,
dictitems
=
None
,
obj
=
None
):
# This API is called by some subclasses
# This API is called by some subclasses
...
@@ -360,16 +357,6 @@ class _Pickler:
...
@@ -360,16 +357,6 @@ class _Pickler:
if
not
hasattr
(
func
,
'__call__'
):
if
not
hasattr
(
func
,
'__call__'
):
raise
PicklingError
(
"func from save_reduce() should be callable"
)
raise
PicklingError
(
"func from save_reduce() should be callable"
)
# Assert that listitems is an iterator
if
listitems
is
not
None
and
not
self
.
_isiter
(
listitems
):
raise
PicklingError
(
"listitems from save_reduce() should be an "
"iterator"
)
# Assert that dictitems is an iterator
if
dictitems
is
not
None
and
not
self
.
_isiter
(
dictitems
):
raise
PicklingError
(
"dictitems from save_reduce() should be an "
"iterator"
)
save
=
self
.
save
save
=
self
.
save
write
=
self
.
write
write
=
self
.
write
...
...
Modules/_pickle.c
Dosyayı görüntüle @
b46a633e
...
@@ -1963,6 +1963,7 @@ save_reduce(PicklerObject *self, PyObject *args, PyObject *obj)
...
@@ -1963,6 +1963,7 @@ save_reduce(PicklerObject *self, PyObject *args, PyObject *obj)
PyObject
*
state
=
NULL
;
PyObject
*
state
=
NULL
;
PyObject
*
listitems
=
Py_None
;
PyObject
*
listitems
=
Py_None
;
PyObject
*
dictitems
=
Py_None
;
PyObject
*
dictitems
=
Py_None
;
Py_ssize_t
size
;
int
use_newobj
=
self
->
proto
>=
2
;
int
use_newobj
=
self
->
proto
>=
2
;
...
@@ -1970,6 +1971,13 @@ save_reduce(PicklerObject *self, PyObject *args, PyObject *obj)
...
@@ -1970,6 +1971,13 @@ save_reduce(PicklerObject *self, PyObject *args, PyObject *obj)
const
char
build_op
=
BUILD
;
const
char
build_op
=
BUILD
;
const
char
newobj_op
=
NEWOBJ
;
const
char
newobj_op
=
NEWOBJ
;
size
=
PyTuple_Size
(
args
);
if
(
size
<
2
||
size
>
5
)
{
PyErr_SetString
(
PicklingError
,
"tuple returned by "
"__reduce__ must contain 2 through 5 elements"
);
return
-
1
;
}
if
(
!
PyArg_UnpackTuple
(
args
,
"save_reduce"
,
2
,
5
,
if
(
!
PyArg_UnpackTuple
(
args
,
"save_reduce"
,
2
,
5
,
&
callable
,
&
argtup
,
&
state
,
&
listitems
,
&
dictitems
))
&
callable
,
&
argtup
,
&
state
,
&
listitems
,
&
dictitems
))
return
-
1
;
return
-
1
;
...
@@ -2146,7 +2154,6 @@ save(PicklerObject *self, PyObject *obj, int pers_save)
...
@@ -2146,7 +2154,6 @@ save(PicklerObject *self, PyObject *obj, int pers_save)
PyObject
*
reduce_value
=
NULL
;
PyObject
*
reduce_value
=
NULL
;
PyObject
*
memo_key
=
NULL
;
PyObject
*
memo_key
=
NULL
;
int
status
=
0
;
int
status
=
0
;
Py_ssize_t
size
;
if
(
Py_EnterRecursiveCall
(
" while pickling an object"
)
<
0
)
if
(
Py_EnterRecursiveCall
(
" while pickling an object"
)
<
0
)
return
-
1
;
return
-
1
;
...
@@ -2325,13 +2332,6 @@ save(PicklerObject *self, PyObject *obj, int pers_save)
...
@@ -2325,13 +2332,6 @@ save(PicklerObject *self, PyObject *obj, int pers_save)
goto
error
;
goto
error
;
}
}
size
=
PyTuple_Size
(
reduce_value
);
if
(
size
<
2
||
size
>
5
)
{
PyErr_SetString
(
PicklingError
,
"tuple returned by "
"__reduce__ must contain 2 through 5 elements"
);
goto
error
;
}
status
=
save_reduce
(
self
,
reduce_value
,
obj
);
status
=
save_reduce
(
self
,
reduce_value
,
obj
);
if
(
0
)
{
if
(
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