Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Include/internal/pycore_global_objects_fini_generated.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions Include/internal/pycore_global_strings.h
Original file line number Diff line number Diff line change
Expand Up @@ -571,6 +571,7 @@ struct _Py_global_strings {
STRUCT_FOR_ID(last_value)
STRUCT_FOR_ID(latin1)
STRUCT_FOR_ID(leaf_size)
STRUCT_FOR_ID(legacy)
STRUCT_FOR_ID(len)
STRUCT_FOR_ID(length)
STRUCT_FOR_ID(level)
Expand Down Expand Up @@ -744,6 +745,7 @@ struct _Py_global_strings {
STRUCT_FOR_ID(setstate)
STRUCT_FOR_ID(shape)
STRUCT_FOR_ID(shared)
STRUCT_FOR_ID(short)
STRUCT_FOR_ID(show_cmd)
STRUCT_FOR_ID(signed)
STRUCT_FOR_ID(signum)
Expand Down
2 changes: 2 additions & 0 deletions Include/internal/pycore_runtime_init_generated.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions Include/internal/pycore_unicodeobject_generated.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 9 additions & 7 deletions Modules/posixmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -2585,7 +2585,8 @@ _posix_free(void *module)
}

static int
fill_time(PyObject *module, PyObject *v, int s_index, int f_index, int ns_index, time_t sec, unsigned long nsec)
fill_time(_posixstate *state, PyObject *v, int s_index, int f_index,
int ns_index, time_t sec, unsigned long nsec)
{
assert(!PyErr_Occurred());
#define SEC_TO_NS (1000000000LL)
Expand Down Expand Up @@ -2628,7 +2629,7 @@ fill_time(PyObject *module, PyObject *v, int s_index, int f_index, int ns_index,
goto exit;
}

s_in_ns = PyNumber_Multiply(s, get_posix_state(module)->billion);
s_in_ns = PyNumber_Multiply(s, state->billion);
if (s_in_ns == NULL) {
goto exit;
}
Expand Down Expand Up @@ -2686,7 +2687,8 @@ _pystat_fromstructstat(PyObject *module, STRUCT_STAT *st)
{
assert(!PyErr_Occurred());

PyObject *StatResultType = get_posix_state(module)->StatResultType;
_posixstate *state = get_posix_state(module);
PyObject *StatResultType = state->StatResultType;
PyObject *v = PyStructSequence_New((PyTypeObject *)StatResultType);
if (v == NULL) {
return NULL;
Expand Down Expand Up @@ -2740,13 +2742,13 @@ _pystat_fromstructstat(PyObject *module, STRUCT_STAT *st)
#else
ansec = mnsec = cnsec = 0;
#endif
if (fill_time(module, v, 7, 10, 13, st->st_atime, ansec) < 0) {
if (fill_time(state, v, 7, 10, 13, st->st_atime, ansec) < 0) {
goto error;
}
if (fill_time(module, v, 8, 11, 14, st->st_mtime, mnsec) < 0) {
if (fill_time(state, v, 8, 11, 14, st->st_mtime, mnsec) < 0) {
goto error;
}
if (fill_time(module, v, 9, 12, 15, st->st_ctime, cnsec) < 0) {
if (fill_time(state, v, 9, 12, 15, st->st_ctime, cnsec) < 0) {
goto error;
}

Expand Down Expand Up @@ -2774,7 +2776,7 @@ _pystat_fromstructstat(PyObject *module, STRUCT_STAT *st)
SET_ITEM(ST_BIRTHTIME_IDX, PyFloat_FromDouble(bsec + bnsec * 1e-9));
}
#elif defined(MS_WINDOWS)
if (fill_time(module, v, -1, ST_BIRTHTIME_IDX, ST_BIRTHTIME_NS_IDX,
if (fill_time(state, v, -1, ST_BIRTHTIME_IDX, ST_BIRTHTIME_NS_IDX,
st->st_birthtime, st->st_birthtime_nsec) < 0) {
goto error;
}
Expand Down
10 changes: 5 additions & 5 deletions Python/sysmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -610,7 +610,7 @@ sys_breakpointhook(PyObject *self, PyObject *const *args, Py_ssize_t nargs, PyOb

if (last_dot == NULL) {
/* The breakpoint is a built-in, e.g. PYTHONBREAKPOINT=int */
modulepath = PyUnicode_FromString("builtins");
modulepath = &_Py_ID(builtins);
attrname = envar;
}
else if (last_dot != envar) {
Expand Down Expand Up @@ -3873,9 +3873,9 @@ _PySys_InitCore(PyThreadState *tstate, PyObject *sysdict)
SET_SYS("builtin_module_names", list_builtin_module_names());
SET_SYS("stdlib_module_names", list_stdlib_module_names());
#if PY_BIG_ENDIAN
SET_SYS_FROM_STRING("byteorder", "big");
SET_SYS("byteorder", &_Py_ID(big));
#else
SET_SYS_FROM_STRING("byteorder", "little");
SET_SYS("byteorder", &_Py_ID(little));
#endif

#ifdef MS_COREDLL
Expand Down Expand Up @@ -3917,9 +3917,9 @@ _PySys_InitCore(PyThreadState *tstate, PyObject *sysdict)

/* float repr style: 0.03 (short) vs 0.029999999999999999 (legacy) */
#if _PY_SHORT_FLOAT_REPR == 1
SET_SYS_FROM_STRING("float_repr_style", "short");
SET_SYS("float_repr_style", &_Py_ID(short));
#else
SET_SYS_FROM_STRING("float_repr_style", "legacy");
SET_SYS("float_repr_style", &_Py_ID(legacy));
#endif

SET_SYS("thread_info", PyThread_GetInfo());
Expand Down
Loading