summaryrefslogtreecommitdiffstats
path: root/Modules/datetimemodule.c
diff options
context:
space:
mode:
authorTim Peters <tim.peters@gmail.com>2003-02-01 02:16:37 (GMT)
committerTim Peters <tim.peters@gmail.com>2003-02-01 02:16:37 (GMT)
commit1f1b2d2e68ef520c2c7a937a4f429020a4627356 (patch)
treee734d7746fc60baa64755a45689f64f0c186a7a3 /Modules/datetimemodule.c
parent371935fc065e69c59c5382cbbf2cb098cf410f0e (diff)
downloadcpython-1f1b2d2e68ef520c2c7a937a4f429020a4627356.zip
cpython-1f1b2d2e68ef520c2c7a937a4f429020a4627356.tar.gz
cpython-1f1b2d2e68ef520c2c7a937a4f429020a4627356.tar.bz2
Removed all uses of the out-of-favor __safe_for_unpickling__ magic
attr, and copy_reg.safe_constructors.
Diffstat (limited to 'Modules/datetimemodule.c')
-rw-r--r--Modules/datetimemodule.c27
1 files changed, 0 insertions, 27 deletions
diff --git a/Modules/datetimemodule.c b/Modules/datetimemodule.c
index c149d1c..054ddd4 100644
--- a/Modules/datetimemodule.c
+++ b/Modules/datetimemodule.c
@@ -4516,13 +4516,6 @@ initdatetime(void)
PyObject *d; /* its dict */
PyObject *x;
- /* Types that use __reduce__ for pickling need to set the following
- * magical attr in the type dict, with a true value.
- */
- PyObject *safepickle = PyString_FromString("__safe_for_unpickling__");
- if (safepickle == NULL)
- return;
-
m = Py_InitModule3("datetime", module_methods,
"Fast implementation of the datetime type.");
@@ -4577,18 +4570,9 @@ initdatetime(void)
}
}
- /* tzinfo values */
- d = PyDateTime_TZInfoType.tp_dict;
-
- if (PyDict_SetItem(d, safepickle, Py_True) < 0)
- return;
-
/* timedelta values */
d = PyDateTime_DeltaType.tp_dict;
- if (PyDict_SetItem(d, safepickle, Py_True) < 0)
- return;
-
x = new_delta(0, 0, 1, 0);
if (x == NULL || PyDict_SetItemString(d, "resolution", x) < 0)
return;
@@ -4607,9 +4591,6 @@ initdatetime(void)
/* date values */
d = PyDateTime_DateType.tp_dict;
- if (PyDict_SetItem(d, safepickle, Py_True) < 0)
- return;
-
x = new_date(1, 1, 1);
if (x == NULL || PyDict_SetItemString(d, "min", x) < 0)
return;
@@ -4628,9 +4609,6 @@ initdatetime(void)
/* time values */
d = PyDateTime_TimeType.tp_dict;
- if (PyDict_SetItem(d, safepickle, Py_True) < 0)
- return;
-
x = new_time(0, 0, 0, 0, Py_None);
if (x == NULL || PyDict_SetItemString(d, "min", x) < 0)
return;
@@ -4649,9 +4627,6 @@ initdatetime(void)
/* datetime values */
d = PyDateTime_DateTimeType.tp_dict;
- if (PyDict_SetItem(d, safepickle, Py_True) < 0)
- return;
-
x = new_datetime(1, 1, 1, 0, 0, 0, 0, Py_None);
if (x == NULL || PyDict_SetItemString(d, "min", x) < 0)
return;
@@ -4667,8 +4642,6 @@ initdatetime(void)
return;
Py_DECREF(x);
- Py_DECREF(safepickle);
-
/* module initialization */
PyModule_AddIntConstant(m, "MINYEAR", MINYEAR);
PyModule_AddIntConstant(m, "MAXYEAR", MAXYEAR);