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
7d4b315c
Kaydet (Commit)
7d4b315c
authored
Ock 08, 2003
tarafından
Tim Peters
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Deleted pickle/unpickle code for the old datetime and time classes -- it's
unreachable now.
üst
0bf60bd6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
160 deletions
+0
-160
datetimemodule.c
Modules/datetimemodule.c
+0
-160
No files found.
Modules/datetimemodule.c
Dosyayı görüntüle @
7d4b315c
...
...
@@ -1399,10 +1399,8 @@ static PyObject *seconds_per_day = NULL; /* 3600*24 as Python int */
/* Callables to support unpickling. */
static
PyObject
*
date_unpickler_object
=
NULL
;
static
PyObject
*
datetime_unpickler_object
=
NULL
;
static
PyObject
*
datetimetz_unpickler_object
=
NULL
;
static
PyObject
*
tzinfo_unpickler_object
=
NULL
;
static
PyObject
*
time_unpickler_object
=
NULL
;
static
PyObject
*
timetz_unpickler_object
=
NULL
;
/* ---------------------------------------------------------------------------
...
...
@@ -3380,52 +3378,6 @@ datetime_setstate(PyDateTime_DateTime *self, PyObject *state)
return
Py_None
;
}
/* XXX This seems a ridiculously inefficient way to pickle a short string. */
static
PyObject
*
datetime_pickler
(
PyObject
*
module
,
PyDateTime_DateTime
*
datetime
)
{
PyObject
*
state
;
PyObject
*
result
=
NULL
;
if
(
!
PyDateTime_CheckExact
(
datetime
))
{
PyErr_Format
(
PyExc_TypeError
,
"bad type passed to datetime pickler: %s"
,
datetime
->
ob_type
->
tp_name
);
return
NULL
;
}
state
=
datetime_getstate
(
datetime
);
if
(
state
)
{
result
=
Py_BuildValue
(
"O(O)"
,
datetime_unpickler_object
,
state
);
Py_DECREF
(
state
);
}
return
result
;
}
static
PyObject
*
datetime_unpickler
(
PyObject
*
module
,
PyObject
*
arg
)
{
PyDateTime_DateTime
*
self
;
if
(
!
PyString_CheckExact
(
arg
))
{
PyErr_Format
(
PyExc_TypeError
,
"bad type passed to datetime unpickler: %s"
,
arg
->
ob_type
->
tp_name
);
return
NULL
;
}
self
=
PyObject_New
(
PyDateTime_DateTime
,
&
PyDateTime_DateTimeType
);
if
(
self
!=
NULL
)
{
PyObject
*
res
=
datetime_setstate
(
self
,
arg
);
if
(
res
==
NULL
)
{
Py_DECREF
(
self
);
return
NULL
;
}
Py_DECREF
(
res
);
}
return
(
PyObject
*
)
self
;
}
static
PyMethodDef
datetime_methods
[]
=
{
/* Class methods: */
{
"now"
,
(
PyCFunction
)
datetime_now
,
...
...
@@ -3849,52 +3801,6 @@ time_setstate(PyDateTime_Time *self, PyObject *state)
return
Py_None
;
}
/* XXX This seems a ridiculously inefficient way to pickle a short string. */
static
PyObject
*
time_pickler
(
PyObject
*
module
,
PyDateTime_Time
*
time
)
{
PyObject
*
state
;
PyObject
*
result
=
NULL
;
if
(
!
PyTime_CheckExact
(
time
))
{
PyErr_Format
(
PyExc_TypeError
,
"bad type passed to time pickler: %s"
,
time
->
ob_type
->
tp_name
);
return
NULL
;
}
state
=
time_getstate
(
time
);
if
(
state
)
{
result
=
Py_BuildValue
(
"O(O)"
,
time_unpickler_object
,
state
);
Py_DECREF
(
state
);
}
return
result
;
}
static
PyObject
*
time_unpickler
(
PyObject
*
module
,
PyObject
*
arg
)
{
PyDateTime_Time
*
self
;
if
(
!
PyString_CheckExact
(
arg
))
{
PyErr_Format
(
PyExc_TypeError
,
"bad type passed to time unpickler: %s"
,
arg
->
ob_type
->
tp_name
);
return
NULL
;
}
self
=
PyObject_New
(
PyDateTime_Time
,
&
PyDateTime_TimeType
);
if
(
self
!=
NULL
)
{
PyObject
*
res
=
time_setstate
(
self
,
arg
);
if
(
res
==
NULL
)
{
Py_DECREF
(
self
);
return
NULL
;
}
Py_DECREF
(
res
);
}
return
(
PyObject
*
)
self
;
}
static
PyMethodDef
time_methods
[]
=
{
{
"isoformat"
,
(
PyCFunction
)
time_isoformat
,
METH_KEYWORDS
,
PyDoc_STR
(
"Return string in ISO 8601 format, HH:MM:SS[.mmmmmm]."
)},
...
...
@@ -5170,12 +5076,8 @@ static PyMethodDef module_methods[] = {
*/
{
"_date_pickler"
,
(
PyCFunction
)
date_pickler
,
METH_O
,
NULL
},
{
"_date_unpickler"
,
(
PyCFunction
)
date_unpickler
,
METH_O
,
NULL
},
{
"_datetime_pickler"
,
(
PyCFunction
)
datetime_pickler
,
METH_O
,
NULL
},
{
"_datetime_unpickler"
,
(
PyCFunction
)
datetime_unpickler
,
METH_O
,
NULL
},
{
"_datetimetz_pickler"
,
(
PyCFunction
)
datetimetz_pickler
,
METH_O
,
NULL
},
{
"_datetimetz_unpickler"
,(
PyCFunction
)
datetimetz_unpickler
,
METH_O
,
NULL
},
{
"_time_pickler"
,
(
PyCFunction
)
time_pickler
,
METH_O
,
NULL
},
{
"_time_unpickler"
,
(
PyCFunction
)
time_unpickler
,
METH_O
,
NULL
},
{
"_timetz_pickler"
,
(
PyCFunction
)
timetz_pickler
,
METH_O
,
NULL
},
{
"_timetz_unpickler"
,
(
PyCFunction
)
timetz_unpickler
,
METH_O
,
NULL
},
{
"_tzinfo_pickler"
,
(
PyCFunction
)
tzinfo_pickler
,
METH_O
,
NULL
},
...
...
@@ -5236,32 +5138,6 @@ initdatetime(void)
Py_DECREF
(
x
);
Py_DECREF
(
pickler
);
pickler
=
PyObject_GetAttrString
(
m
,
"_datetime_pickler"
);
if
(
pickler
==
NULL
)
return
;
datetime_unpickler_object
=
PyObject_GetAttrString
(
m
,
"_datetime_unpickler"
);
if
(
datetime_unpickler_object
==
NULL
)
return
;
x
=
PyObject_CallMethod
(
copyreg
,
"pickle"
,
"OOO"
,
&
PyDateTime_DateTimeType
,
pickler
,
datetime_unpickler_object
);
if
(
x
==
NULL
)
return
;
Py_DECREF
(
x
);
Py_DECREF
(
pickler
);
pickler
=
PyObject_GetAttrString
(
m
,
"_time_pickler"
);
if
(
pickler
==
NULL
)
return
;
time_unpickler_object
=
PyObject_GetAttrString
(
m
,
"_time_unpickler"
);
if
(
time_unpickler_object
==
NULL
)
return
;
x
=
PyObject_CallMethod
(
copyreg
,
"pickle"
,
"OOO"
,
&
PyDateTime_TimeType
,
pickler
,
time_unpickler_object
);
if
(
x
==
NULL
)
return
;
Py_DECREF
(
x
);
Py_DECREF
(
pickler
);
pickler
=
PyObject_GetAttrString
(
m
,
"_timetz_pickler"
);
if
(
pickler
==
NULL
)
return
;
timetz_unpickler_object
=
PyObject_GetAttrString
(
m
,
...
...
@@ -5343,42 +5219,6 @@ initdatetime(void)
return
;
Py_DECREF
(
x
);
/* datetime values */
d
=
PyDateTime_DateTimeType
.
tp_dict
;
x
=
new_datetime
(
1
,
1
,
1
,
0
,
0
,
0
,
0
);
if
(
x
==
NULL
||
PyDict_SetItemString
(
d
,
"min"
,
x
)
<
0
)
return
;
Py_DECREF
(
x
);
x
=
new_datetime
(
MAXYEAR
,
12
,
31
,
23
,
59
,
59
,
999999
);
if
(
x
==
NULL
||
PyDict_SetItemString
(
d
,
"max"
,
x
)
<
0
)
return
;
Py_DECREF
(
x
);
x
=
new_delta
(
0
,
0
,
1
,
0
);
if
(
x
==
NULL
||
PyDict_SetItemString
(
d
,
"resolution"
,
x
)
<
0
)
return
;
Py_DECREF
(
x
);
/* time values */
d
=
PyDateTime_TimeType
.
tp_dict
;
x
=
new_time
(
0
,
0
,
0
,
0
);
if
(
x
==
NULL
||
PyDict_SetItemString
(
d
,
"min"
,
x
)
<
0
)
return
;
Py_DECREF
(
x
);
x
=
new_time
(
23
,
59
,
59
,
999999
);
if
(
x
==
NULL
||
PyDict_SetItemString
(
d
,
"max"
,
x
)
<
0
)
return
;
Py_DECREF
(
x
);
x
=
new_delta
(
0
,
0
,
1
,
0
);
if
(
x
==
NULL
||
PyDict_SetItemString
(
d
,
"resolution"
,
x
)
<
0
)
return
;
Py_DECREF
(
x
);
/* timetz values */
d
=
PyDateTime_TimeTZType
.
tp_dict
;
...
...
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