summaryrefslogtreecommitdiffstats
path: root/Modules/timemodule.c
diff options
context:
space:
mode:
authorAlexander Belopolsky <alexander.belopolsky@gmail.com>2010-06-16 22:38:15 (GMT)
committerAlexander Belopolsky <alexander.belopolsky@gmail.com>2010-06-16 22:38:15 (GMT)
commitd95a586d7760731c6c842a1bdfdbb572257bb8ed (patch)
tree252a1a2c0b5165ed85414163a6afa3a70bfb3c6c /Modules/timemodule.c
parent294f27141f170a09916341a8fcc49903b8e4359e (diff)
downloadcpython-d95a586d7760731c6c842a1bdfdbb572257bb8ed.zip
cpython-d95a586d7760731c6c842a1bdfdbb572257bb8ed.tar.gz
cpython-d95a586d7760731c6c842a1bdfdbb572257bb8ed.tar.bz2
Issue #9012: "Separate compilation of time and datetime modules."
Segregated code shared between time and datetime modules into Modules/_time.c. Added a new header file, Modules/_time.h, which will be used instead of Include/timefuncs.h for declarations shared between time and datetime modules.
Diffstat (limited to 'Modules/timemodule.c')
-rw-r--r--Modules/timemodule.c26
1 files changed, 0 insertions, 26 deletions
diff --git a/Modules/timemodule.c b/Modules/timemodule.c
index 18fe13f..c4b5014 100644
--- a/Modules/timemodule.c
+++ b/Modules/timemodule.c
@@ -90,32 +90,6 @@ static double floattime(void);
/* For Y2K check */
static PyObject *moddict;
-/* Exposed in timefuncs.h. */
-time_t
-_PyTime_DoubleToTimet(double x)
-{
- time_t result;
- double diff;
-
- result = (time_t)x;
- /* How much info did we lose? time_t may be an integral or
- * floating type, and we don't know which. If it's integral,
- * we don't know whether C truncates, rounds, returns the floor,
- * etc. If we lost a second or more, the C rounding is
- * unreasonable, or the input just doesn't fit in a time_t;
- * call it an error regardless. Note that the original cast to
- * time_t can cause a C error too, but nothing we can do to
- * worm around that.
- */
- diff = x - (double)result;
- if (diff <= -1.0 || diff >= 1.0) {
- PyErr_SetString(PyExc_ValueError,
- "timestamp out of range for platform time_t");
- result = (time_t)-1;
- }
- return result;
-}
-
static PyObject *
time_time(PyObject *self, PyObject *unused)
{