Staging
v0.5.1
https://github.com/python/cpython
Revision 27b38b99b3a154fa5c25cd67fe01fb4fc04604b0 authored by Paul Ganssle on 15 August 2019, 19:08:57 UTC, committed by GitHub on 15 August 2019, 19:08:57 UTC
This fixes an inconsistency between the Python and C implementations of
the datetime module. The pure python version of the code was not
accepting offsets greater than 23:59 but less than 24:00. This is an
accidental legacy of the original implementation, which was put in place
before tzinfo allowed sub-minute time zone offsets.

GH-14878

(cherry picked from commit 92c7e30adf5c81a54d6e5e555a6bdfaa60157a0d)
1 parent 64db5aa
Raw File
Tip revision: 27b38b99b3a154fa5c25cd67fe01fb4fc04604b0 authored by Paul Ganssle on 15 August 2019, 19:08:57 UTC
bpo-37642: Update acceptable offsets in timezone (GH-14878) (#15227)
Tip revision: 27b38b9
_testimportmultiple.c
/*
 * C extensions module to test importing multiple modules from one compiled
 * file (issue16421). This file defines 3 modules (_testimportmodule,
 * foo, bar), only the first one is called the same as the compiled file.
 */
#include<Python.h>

static struct PyModuleDef _testimportmultiple = {
    PyModuleDef_HEAD_INIT,
    "_testimportmultiple",
    "_testimportmultiple doc",
    -1,
    NULL,
    NULL,
    NULL,
    NULL,
    NULL
};

PyMODINIT_FUNC PyInit__testimportmultiple(void)
{
    return PyModule_Create(&_testimportmultiple);
}

static struct PyModuleDef _foomodule = {
    PyModuleDef_HEAD_INIT,
    "_testimportmultiple_foo",
    "_testimportmultiple_foo doc",
    -1,
    NULL,
    NULL,
    NULL,
    NULL,
    NULL
};

PyMODINIT_FUNC PyInit__testimportmultiple_foo(void)
{
    return PyModule_Create(&_foomodule);
}

static struct PyModuleDef _barmodule = {
    PyModuleDef_HEAD_INIT,
    "_testimportmultiple_bar",
    "_testimportmultiple_bar doc",
    -1,
    NULL,
    NULL,
    NULL,
    NULL,
    NULL
};

PyMODINIT_FUNC PyInit__testimportmultiple_bar(void){
    return PyModule_Create(&_barmodule);
}

back to top