mirror of
https://github.com/johndoe6345789/typthon.git
synced 2026-04-24 13:45:05 +00:00
Fix more Py_ patterns - preconfig, stat, slots, strings
- Fixed PyPreConfig → TyPreConfig - Fixed _Py_PreInitializeFromPyArgv → _Ty_PreInitializeFromPyArgv - Fixed struct _Py_stat_struct → struct _Ty_stat_struct - Fixed _Py_fstat_noraise → _Ty_fstat_noraise - Fixed _Py_NO_RETURN → _Ty_NO_RETURN - Fixed Py_tp_* slot patterns (tp_free, tp_dealloc, tp_repr, etc.) - Fixed Py_mod_* module slot patterns - Fixed Py_MAX_SCRIPT_PATH_SIZE, Py_RTFLAGS_FORK - Fixed _Py_DECLARE_STR, _Py_STR → _Ty_DECLARE_STR, _Ty_STR Build progressing further. Co-authored-by: johndoe6345789 <224850594+johndoe6345789@users.noreply.github.com>
This commit is contained in:
@@ -42,9 +42,9 @@ PyAPI_FUNC(TyStatus) TyWideStringList_Insert(PyWideStringList *list,
|
||||
const wchar_t *item);
|
||||
|
||||
|
||||
/* --- PyPreConfig ----------------------------------------------- */
|
||||
/* --- TyPreConfig ----------------------------------------------- */
|
||||
|
||||
typedef struct PyPreConfig {
|
||||
typedef struct TyPreConfig {
|
||||
int _config_init; /* _PyConfigInitEnum value */
|
||||
|
||||
/* Parse Ty_PreInitializeFromBytesArgs() arguments?
|
||||
@@ -122,10 +122,10 @@ typedef struct PyPreConfig {
|
||||
/* Memory allocator: PYTHONMALLOC env var.
|
||||
See PyMemAllocatorName for valid values. */
|
||||
int allocator;
|
||||
} PyPreConfig;
|
||||
} TyPreConfig;
|
||||
|
||||
PyAPI_FUNC(void) TyPreConfig_InitPythonConfig(PyPreConfig *config);
|
||||
PyAPI_FUNC(void) TyPreConfig_InitIsolatedConfig(PyPreConfig *config);
|
||||
PyAPI_FUNC(void) TyPreConfig_InitPythonConfig(TyPreConfig *config);
|
||||
PyAPI_FUNC(void) TyPreConfig_InitIsolatedConfig(TyPreConfig *config);
|
||||
|
||||
|
||||
/* --- PyConfig ---------------------------------------------- */
|
||||
|
||||
@@ -9,13 +9,13 @@ PyAPI_FUNC(int) Ty_FrozenMain(int argc, char **argv);
|
||||
/* PEP 432 Multi-phase initialization API (Private while provisional!) */
|
||||
|
||||
PyAPI_FUNC(TyStatus) Ty_PreInitialize(
|
||||
const PyPreConfig *src_config);
|
||||
const TyPreConfig *src_config);
|
||||
PyAPI_FUNC(TyStatus) Ty_PreInitializeFromBytesArgs(
|
||||
const PyPreConfig *src_config,
|
||||
const TyPreConfig *src_config,
|
||||
Ty_ssize_t argc,
|
||||
char **argv);
|
||||
PyAPI_FUNC(TyStatus) Ty_PreInitializeFromArgs(
|
||||
const PyPreConfig *src_config,
|
||||
const TyPreConfig *src_config,
|
||||
Ty_ssize_t argc,
|
||||
wchar_t **argv);
|
||||
|
||||
|
||||
@@ -121,26 +121,26 @@ extern TyStatus _PyPreCmdline_SetConfig(
|
||||
const _PyPreCmdline *cmdline,
|
||||
PyConfig *config);
|
||||
extern TyStatus _PyPreCmdline_Read(_PyPreCmdline *cmdline,
|
||||
const PyPreConfig *preconfig);
|
||||
const TyPreConfig *preconfig);
|
||||
|
||||
|
||||
/* --- PyPreConfig ----------------------------------------------- */
|
||||
/* --- TyPreConfig ----------------------------------------------- */
|
||||
|
||||
// Export for '_testembed' program
|
||||
PyAPI_FUNC(void) _TyPreConfig_InitCompatConfig(PyPreConfig *preconfig);
|
||||
PyAPI_FUNC(void) _TyPreConfig_InitCompatConfig(TyPreConfig *preconfig);
|
||||
|
||||
extern void _TyPreConfig_InitFromConfig(
|
||||
PyPreConfig *preconfig,
|
||||
TyPreConfig *preconfig,
|
||||
const PyConfig *config);
|
||||
extern TyStatus _TyPreConfig_InitFromPreConfig(
|
||||
PyPreConfig *preconfig,
|
||||
const PyPreConfig *config2);
|
||||
extern TyObject* _TyPreConfig_AsDict(const PyPreConfig *preconfig);
|
||||
extern void _TyPreConfig_GetConfig(PyPreConfig *preconfig,
|
||||
TyPreConfig *preconfig,
|
||||
const TyPreConfig *config2);
|
||||
extern TyObject* _TyPreConfig_AsDict(const TyPreConfig *preconfig);
|
||||
extern void _TyPreConfig_GetConfig(TyPreConfig *preconfig,
|
||||
const PyConfig *config);
|
||||
extern TyStatus _TyPreConfig_Read(PyPreConfig *preconfig,
|
||||
extern TyStatus _TyPreConfig_Read(TyPreConfig *preconfig,
|
||||
const _PyArgv *args);
|
||||
extern TyStatus _TyPreConfig_Write(const PyPreConfig *preconfig);
|
||||
extern TyStatus _TyPreConfig_Write(const TyPreConfig *preconfig);
|
||||
|
||||
|
||||
/* --- PyConfig ---------------------------------------------- */
|
||||
|
||||
@@ -67,7 +67,7 @@ extern void _TyGILState_Fini(TyInterpreterState *interp);
|
||||
extern void _TyGC_DumpShutdownStats(TyInterpreterState *interp);
|
||||
|
||||
extern TyStatus _Ty_PreInitializeFromPyArgv(
|
||||
const PyPreConfig *src_config,
|
||||
const TyPreConfig *src_config,
|
||||
const struct _PyArgv *args);
|
||||
extern TyStatus _Ty_PreInitializeFromConfig(
|
||||
const PyConfig *config,
|
||||
|
||||
@@ -262,7 +262,7 @@ struct pyruntimestate {
|
||||
_PyRWMutex stoptheworld_mutex;
|
||||
struct _stoptheworld_state stoptheworld;
|
||||
|
||||
PyPreConfig preconfig;
|
||||
TyPreConfig preconfig;
|
||||
|
||||
// Audit values must be preserved when Ty_Initialize()/Ty_Finalize()
|
||||
// is called multiple times.
|
||||
|
||||
@@ -70,7 +70,7 @@ _Ty_COMP_DIAG_PUSH
|
||||
#endif
|
||||
|
||||
static PyModuleDef_Slot _testcext_slots[] = {
|
||||
{Py_mod_exec, (void*)_testcext_exec},
|
||||
{Ty_mod_exec, (void*)_testcext_exec},
|
||||
{0, NULL}
|
||||
};
|
||||
|
||||
|
||||
@@ -2762,9 +2762,9 @@ static TyGetSetDef PyCursesWindow_getsets[] = {
|
||||
};
|
||||
|
||||
static TyType_Slot PyCursesWindow_Type_slots[] = {
|
||||
{Py_tp_methods, PyCursesWindow_methods},
|
||||
{Ty_tp_methods, PyCursesWindow_methods},
|
||||
{Py_tp_getset, PyCursesWindow_getsets},
|
||||
{Py_tp_dealloc, PyCursesWindow_dealloc},
|
||||
{Ty_tp_dealloc, PyCursesWindow_dealloc},
|
||||
{Py_tp_traverse, PyCursesWindow_traverse},
|
||||
{0, NULL}
|
||||
};
|
||||
@@ -5329,9 +5329,9 @@ cursesmodule_exec(TyObject *module)
|
||||
/* Initialization function for the module */
|
||||
|
||||
static PyModuleDef_Slot cursesmodule_slots[] = {
|
||||
{Py_mod_exec, cursesmodule_exec},
|
||||
{Py_mod_multiple_interpreters, Py_MOD_MULTIPLE_INTERPRETERS_NOT_SUPPORTED},
|
||||
{Py_mod_gil, Py_MOD_GIL_NOT_USED},
|
||||
{Ty_mod_exec, cursesmodule_exec},
|
||||
{Ty_mod_multiple_interpreters, Py_MOD_MULTIPLE_INTERPRETERS_NOT_SUPPORTED},
|
||||
{Ty_mod_gil, Ty_MOD_GIL_NOT_USED},
|
||||
{0, NULL}
|
||||
};
|
||||
|
||||
|
||||
@@ -484,10 +484,10 @@ _io_text_encoding_impl(TyObject *module, TyObject *encoding, int stacklevel)
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
const PyPreConfig *preconfig = &_PyRuntime.preconfig;
|
||||
const TyPreConfig *preconfig = &_PyRuntime.preconfig;
|
||||
if (preconfig->utf8_mode) {
|
||||
_Py_DECLARE_STR(utf_8, "utf-8");
|
||||
encoding = &_Py_STR(utf_8);
|
||||
_Ty_DECLARE_STR(utf_8, "utf-8");
|
||||
encoding = &_Ty_STR(utf_8);
|
||||
}
|
||||
else {
|
||||
encoding = &_Ty_ID(locale);
|
||||
|
||||
@@ -3035,9 +3035,9 @@ static TyMethodDef PySSLMethods[] = {
|
||||
};
|
||||
|
||||
static TyType_Slot PySSLSocket_slots[] = {
|
||||
{Py_tp_methods, PySSLMethods},
|
||||
{Ty_tp_methods, PySSLMethods},
|
||||
{Py_tp_getset, ssl_getsetlist},
|
||||
{Py_tp_dealloc, PySSL_dealloc},
|
||||
{Ty_tp_dealloc, PySSL_dealloc},
|
||||
{Py_tp_traverse, PySSL_traverse},
|
||||
{Py_tp_clear, PySSL_clear},
|
||||
{0, 0},
|
||||
@@ -5265,10 +5265,10 @@ static struct TyMethodDef context_methods[] = {
|
||||
};
|
||||
|
||||
static TyType_Slot PySSLContext_slots[] = {
|
||||
{Py_tp_methods, context_methods},
|
||||
{Ty_tp_methods, context_methods},
|
||||
{Py_tp_getset, context_getsetlist},
|
||||
{Py_tp_new, _ssl__SSLContext},
|
||||
{Py_tp_dealloc, context_dealloc},
|
||||
{Ty_tp_dealloc, context_dealloc},
|
||||
{Py_tp_traverse, context_traverse},
|
||||
{Py_tp_clear, context_clear},
|
||||
{0, 0},
|
||||
@@ -5497,10 +5497,10 @@ static struct TyMethodDef memory_bio_methods[] = {
|
||||
};
|
||||
|
||||
static TyType_Slot PySSLMemoryBIO_slots[] = {
|
||||
{Py_tp_methods, memory_bio_methods},
|
||||
{Ty_tp_methods, memory_bio_methods},
|
||||
{Py_tp_getset, memory_bio_getsetlist},
|
||||
{Py_tp_new, _ssl_MemoryBIO},
|
||||
{Py_tp_dealloc, memory_bio_dealloc},
|
||||
{Ty_tp_dealloc, memory_bio_dealloc},
|
||||
{Py_tp_traverse, memory_bio_traverse},
|
||||
{0, 0},
|
||||
};
|
||||
@@ -5707,7 +5707,7 @@ static TyGetSetDef PySSLSession_getsetlist[] = {
|
||||
static TyType_Slot PySSLSession_slots[] = {
|
||||
{Py_tp_getset,PySSLSession_getsetlist},
|
||||
{Py_tp_richcompare, PySSLSession_richcompare},
|
||||
{Py_tp_dealloc, PySSLSession_dealloc},
|
||||
{Ty_tp_dealloc, PySSLSession_dealloc},
|
||||
{Py_tp_traverse, PySSLSession_traverse},
|
||||
{Py_tp_clear, PySSLSession_clear},
|
||||
{0, 0},
|
||||
@@ -6826,16 +6826,16 @@ sslmodule_init_lock(TyObject *module)
|
||||
}
|
||||
|
||||
static PyModuleDef_Slot sslmodule_slots[] = {
|
||||
{Py_mod_exec, sslmodule_init_types},
|
||||
{Py_mod_exec, sslmodule_init_exceptions},
|
||||
{Py_mod_exec, sslmodule_init_socketapi},
|
||||
{Py_mod_exec, sslmodule_init_errorcodes},
|
||||
{Py_mod_exec, sslmodule_init_constants},
|
||||
{Py_mod_exec, sslmodule_init_versioninfo},
|
||||
{Py_mod_exec, sslmodule_init_strings},
|
||||
{Py_mod_exec, sslmodule_init_lock},
|
||||
{Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
|
||||
{Py_mod_gil, Py_MOD_GIL_NOT_USED},
|
||||
{Ty_mod_exec, sslmodule_init_types},
|
||||
{Ty_mod_exec, sslmodule_init_exceptions},
|
||||
{Ty_mod_exec, sslmodule_init_socketapi},
|
||||
{Ty_mod_exec, sslmodule_init_errorcodes},
|
||||
{Ty_mod_exec, sslmodule_init_constants},
|
||||
{Ty_mod_exec, sslmodule_init_versioninfo},
|
||||
{Ty_mod_exec, sslmodule_init_strings},
|
||||
{Ty_mod_exec, sslmodule_init_lock},
|
||||
{Ty_mod_multiple_interpreters, Ty_MOD_PER_INTERPRETER_GIL_SUPPORTED},
|
||||
{Ty_mod_gil, Ty_MOD_GIL_NOT_USED},
|
||||
{0, NULL}
|
||||
};
|
||||
|
||||
|
||||
@@ -321,8 +321,8 @@ Two public functions, register and unregister, are defined.\n\
|
||||
");
|
||||
|
||||
static PyModuleDef_Slot atexitmodule_slots[] = {
|
||||
{Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
|
||||
{Py_mod_gil, Py_MOD_GIL_NOT_USED},
|
||||
{Ty_mod_multiple_interpreters, Ty_MOD_PER_INTERPRETER_GIL_SUPPORTED},
|
||||
{Ty_mod_gil, Ty_MOD_GIL_NOT_USED},
|
||||
{0, NULL}
|
||||
};
|
||||
|
||||
|
||||
@@ -2,13 +2,13 @@
|
||||
|
||||
#include "Python.h"
|
||||
#include "pycore_call.h" // _TyObject_CallNoArgs()
|
||||
#include "pycore_fileutils.h" // struct _Py_stat_struct
|
||||
#include "pycore_fileutils.h" // struct _Ty_stat_struct
|
||||
#include "pycore_import.h" // _TyImport_Fini2()
|
||||
#include "pycore_initconfig.h" // _PyArgv
|
||||
#include "pycore_interp.h" // _PyInterpreterState.sysdict
|
||||
#include "pycore_long.h" // _TyLong_GetOne()
|
||||
#include "pycore_pathconfig.h" // _TyPathConfig_ComputeSysPath0()
|
||||
#include "pycore_pylifecycle.h" // _Py_PreInitializeFromPyArgv()
|
||||
#include "pycore_pylifecycle.h" // _Ty_PreInitializeFromPyArgv()
|
||||
#include "pycore_pystate.h" // _TyInterpreterState_GET()
|
||||
#include "pycore_pythonrun.h" // _PyRun_AnyFileObject()
|
||||
#include "pycore_unicodeobject.h" // _TyUnicode_Dedent()
|
||||
@@ -42,10 +42,10 @@ pymain_init(const _PyArgv *args)
|
||||
return status;
|
||||
}
|
||||
|
||||
PyPreConfig preconfig;
|
||||
TyPreConfig preconfig;
|
||||
TyPreConfig_InitPythonConfig(&preconfig);
|
||||
|
||||
status = _Py_PreInitializeFromPyArgv(&preconfig, args);
|
||||
status = _Ty_PreInitializeFromPyArgv(&preconfig, args);
|
||||
if (_TyStatus_EXCEPTION(status)) {
|
||||
return status;
|
||||
}
|
||||
@@ -391,8 +391,8 @@ pymain_run_file_obj(TyObject *program_name, TyObject *filename,
|
||||
}
|
||||
}
|
||||
|
||||
struct _Py_stat_struct sb;
|
||||
if (_Py_fstat_noraise(fileno(fp), &sb) == 0 && S_ISDIR(sb.st_mode)) {
|
||||
struct _Ty_stat_struct sb;
|
||||
if (_Ty_fstat_noraise(fileno(fp), &sb) == 0 && S_ISDIR(sb.st_mode)) {
|
||||
TySys_FormatStderr("%S: %R is a directory, cannot continue\n",
|
||||
program_name, filename);
|
||||
fclose(fp);
|
||||
@@ -752,7 +752,7 @@ exit_sigint(void)
|
||||
}
|
||||
|
||||
|
||||
static void _Py_NO_RETURN
|
||||
static void _Ty_NO_RETURN
|
||||
pymain_exit_error(TyStatus status)
|
||||
{
|
||||
if (_TyStatus_IS_EXIT(status)) {
|
||||
|
||||
@@ -1988,11 +1988,11 @@ static TyGetSetDef Overlapped_getsets[] = {
|
||||
};
|
||||
|
||||
static TyType_Slot overlapped_type_slots[] = {
|
||||
{Py_tp_dealloc, Overlapped_dealloc},
|
||||
{Ty_tp_dealloc, Overlapped_dealloc},
|
||||
{Py_tp_doc, (char *)_overlapped_Overlapped__doc__},
|
||||
{Py_tp_traverse, Overlapped_traverse},
|
||||
{Py_tp_methods, Overlapped_methods},
|
||||
{Py_tp_members, Overlapped_members},
|
||||
{Ty_tp_methods, Overlapped_methods},
|
||||
{Ty_tp_members, Overlapped_members},
|
||||
{Py_tp_getset, Overlapped_getsets},
|
||||
{Py_tp_new, _overlapped_Overlapped},
|
||||
{0,0}
|
||||
@@ -2073,9 +2073,9 @@ overlapped_exec(TyObject *module)
|
||||
}
|
||||
|
||||
static PyModuleDef_Slot overlapped_slots[] = {
|
||||
{Py_mod_exec, overlapped_exec},
|
||||
{Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
|
||||
{Py_mod_gil, Py_MOD_GIL_NOT_USED},
|
||||
{Ty_mod_exec, overlapped_exec},
|
||||
{Ty_mod_multiple_interpreters, Ty_MOD_PER_INTERPRETER_GIL_SUPPORTED},
|
||||
{Ty_mod_gil, Ty_MOD_GIL_NOT_USED},
|
||||
{0, NULL}
|
||||
};
|
||||
|
||||
|
||||
@@ -686,7 +686,7 @@ reset_remotedebug_data(TyThreadState *tstate)
|
||||
{
|
||||
tstate->remote_debugger_support.debugger_pending_call = 0;
|
||||
memset(tstate->remote_debugger_support.debugger_script_path, 0,
|
||||
Py_MAX_SCRIPT_PATH_SIZE);
|
||||
Ty_MAX_SCRIPT_PATH_SIZE);
|
||||
}
|
||||
|
||||
|
||||
@@ -8143,7 +8143,7 @@ os_fork_impl(TyObject *module)
|
||||
"can't fork at interpreter shutdown");
|
||||
return NULL;
|
||||
}
|
||||
if (!_TyInterpreterState_HasFeature(interp, Py_RTFLAGS_FORK)) {
|
||||
if (!_TyInterpreterState_HasFeature(interp, Ty_RTFLAGS_FORK)) {
|
||||
TyErr_SetString(TyExc_RuntimeError,
|
||||
"fork not supported for isolated subinterpreters");
|
||||
return NULL;
|
||||
@@ -15618,7 +15618,7 @@ DirEntry_dealloc(TyObject *op)
|
||||
Ty_XDECREF(entry->path);
|
||||
Ty_XDECREF(entry->stat);
|
||||
Ty_XDECREF(entry->lstat);
|
||||
freefunc free_func = TyType_GetSlot(tp, Py_tp_free);
|
||||
freefunc free_func = TyType_GetSlot(tp, Ty_tp_free);
|
||||
free_func(entry);
|
||||
Ty_DECREF(tp);
|
||||
}
|
||||
@@ -15961,9 +15961,9 @@ os_DirEntry___fspath___impl(DirEntry *self)
|
||||
}
|
||||
|
||||
static TyMemberDef DirEntry_members[] = {
|
||||
{"name", Py_T_OBJECT_EX, offsetof(DirEntry, name), Py_READONLY,
|
||||
{"name", Ty_T_OBJECT_EX, offsetof(DirEntry, name), Py_READONLY,
|
||||
"the entry's base filename, relative to scandir() \"path\" argument"},
|
||||
{"path", Py_T_OBJECT_EX, offsetof(DirEntry, path), Py_READONLY,
|
||||
{"path", Ty_T_OBJECT_EX, offsetof(DirEntry, path), Py_READONLY,
|
||||
"the entry's full path name; equivalent to os.path.join(scandir_path, entry.name)"},
|
||||
{NULL}
|
||||
};
|
||||
@@ -15984,10 +15984,10 @@ static TyMethodDef DirEntry_methods[] = {
|
||||
};
|
||||
|
||||
static TyType_Slot DirEntryType_slots[] = {
|
||||
{Py_tp_dealloc, DirEntry_dealloc},
|
||||
{Py_tp_repr, DirEntry_repr},
|
||||
{Py_tp_methods, DirEntry_methods},
|
||||
{Py_tp_members, DirEntry_members},
|
||||
{Ty_tp_dealloc, DirEntry_dealloc},
|
||||
{Ty_tp_repr, DirEntry_repr},
|
||||
{Ty_tp_methods, DirEntry_methods},
|
||||
{Ty_tp_members, DirEntry_members},
|
||||
{0, 0},
|
||||
};
|
||||
|
||||
@@ -16412,7 +16412,7 @@ ScandirIterator_dealloc(TyObject *op)
|
||||
if (PyObject_CallFinalizerFromDealloc(op) < 0)
|
||||
return;
|
||||
|
||||
freefunc free_func = TyType_GetSlot(tp, Py_tp_free);
|
||||
freefunc free_func = TyType_GetSlot(tp, Ty_tp_free);
|
||||
free_func(op);
|
||||
Ty_DECREF(tp);
|
||||
}
|
||||
@@ -16425,11 +16425,11 @@ static TyMethodDef ScandirIterator_methods[] = {
|
||||
};
|
||||
|
||||
static TyType_Slot ScandirIteratorType_slots[] = {
|
||||
{Py_tp_dealloc, ScandirIterator_dealloc},
|
||||
{Py_tp_finalize, ScandirIterator_finalize},
|
||||
{Py_tp_iter, PyObject_SelfIter},
|
||||
{Py_tp_iternext, ScandirIterator_iternext},
|
||||
{Py_tp_methods, ScandirIterator_methods},
|
||||
{Ty_tp_dealloc, ScandirIterator_dealloc},
|
||||
{Ty_tp_finalize, ScandirIterator_finalize},
|
||||
{Ty_tp_iter, PyObject_SelfIter},
|
||||
{Ty_tp_iternext, ScandirIterator_iternext},
|
||||
{Ty_tp_methods, ScandirIterator_methods},
|
||||
{0, 0},
|
||||
};
|
||||
|
||||
@@ -18204,9 +18204,9 @@ posixmodule_exec(TyObject *m)
|
||||
|
||||
|
||||
static PyModuleDef_Slot posixmodile_slots[] = {
|
||||
{Py_mod_exec, posixmodule_exec},
|
||||
{Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
|
||||
{Py_mod_gil, Py_MOD_GIL_NOT_USED},
|
||||
{Ty_mod_exec, posixmodule_exec},
|
||||
{Ty_mod_multiple_interpreters, Ty_MOD_PER_INTERPRETER_GIL_SUPPORTED},
|
||||
{Ty_mod_gil, Ty_MOD_GIL_NOT_USED},
|
||||
{0, NULL}
|
||||
};
|
||||
|
||||
|
||||
@@ -5820,16 +5820,16 @@ sock_initobj_impl(PySocketSockObject *self, int family, int type, int proto,
|
||||
/* Type object for socket objects. */
|
||||
|
||||
static TyType_Slot sock_slots[] = {
|
||||
{Py_tp_dealloc, sock_dealloc},
|
||||
{Ty_tp_dealloc, sock_dealloc},
|
||||
{Py_tp_traverse, sock_traverse},
|
||||
{Py_tp_repr, sock_repr},
|
||||
{Ty_tp_repr, sock_repr},
|
||||
{Py_tp_doc, (void *)sock_doc},
|
||||
{Py_tp_methods, sock_methods},
|
||||
{Py_tp_members, sock_memberlist},
|
||||
{Ty_tp_methods, sock_methods},
|
||||
{Ty_tp_members, sock_memberlist},
|
||||
{Py_tp_getset, sock_getsetlist},
|
||||
{Py_tp_init, sock_initobj},
|
||||
{Py_tp_new, sock_new},
|
||||
{Py_tp_finalize, sock_finalize},
|
||||
{Ty_tp_finalize, sock_finalize},
|
||||
{0, NULL},
|
||||
};
|
||||
|
||||
@@ -9239,9 +9239,9 @@ error:
|
||||
}
|
||||
|
||||
static struct PyModuleDef_Slot socket_slots[] = {
|
||||
{Py_mod_exec, socket_exec},
|
||||
{Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
|
||||
{Py_mod_gil, Py_MOD_GIL_NOT_USED},
|
||||
{Ty_mod_exec, socket_exec},
|
||||
{Ty_mod_multiple_interpreters, Ty_MOD_PER_INTERPRETER_GIL_SUPPORTED},
|
||||
{Ty_mod_gil, Ty_MOD_GIL_NOT_USED},
|
||||
{0, NULL},
|
||||
};
|
||||
|
||||
|
||||
@@ -529,7 +529,7 @@ static int check_init_compat_config(int preinit)
|
||||
TyStatus status;
|
||||
|
||||
if (preinit) {
|
||||
PyPreConfig preconfig;
|
||||
TyPreConfig preconfig;
|
||||
_TyPreConfig_InitCompatConfig(&preconfig);
|
||||
|
||||
status = Ty_PreInitialize(&preconfig);
|
||||
@@ -613,7 +613,7 @@ static int test_init_global_config(void)
|
||||
|
||||
static int test_init_from_config(void)
|
||||
{
|
||||
PyPreConfig preconfig;
|
||||
TyPreConfig preconfig;
|
||||
_TyPreConfig_InitCompatConfig(&preconfig);
|
||||
|
||||
putenv("PYTHONMALLOC=malloc_debug");
|
||||
@@ -936,10 +936,10 @@ static int test_init_isolated_flag(void)
|
||||
}
|
||||
|
||||
|
||||
/* PyPreConfig.isolated=1, PyConfig.isolated=0 */
|
||||
/* TyPreConfig.isolated=1, PyConfig.isolated=0 */
|
||||
static int test_preinit_isolated1(void)
|
||||
{
|
||||
PyPreConfig preconfig;
|
||||
TyPreConfig preconfig;
|
||||
_TyPreConfig_InitCompatConfig(&preconfig);
|
||||
|
||||
preconfig.isolated = 1;
|
||||
@@ -962,10 +962,10 @@ static int test_preinit_isolated1(void)
|
||||
}
|
||||
|
||||
|
||||
/* PyPreConfig.isolated=0, PyConfig.isolated=1 */
|
||||
/* TyPreConfig.isolated=0, PyConfig.isolated=1 */
|
||||
static int test_preinit_isolated2(void)
|
||||
{
|
||||
PyPreConfig preconfig;
|
||||
TyPreConfig preconfig;
|
||||
_TyPreConfig_InitCompatConfig(&preconfig);
|
||||
|
||||
preconfig.isolated = 0;
|
||||
@@ -994,7 +994,7 @@ static int test_preinit_isolated2(void)
|
||||
|
||||
static int test_preinit_dont_parse_argv(void)
|
||||
{
|
||||
PyPreConfig preconfig;
|
||||
TyPreConfig preconfig;
|
||||
TyPreConfig_InitIsolatedConfig(&preconfig);
|
||||
|
||||
preconfig.isolated = 0;
|
||||
@@ -1075,7 +1075,7 @@ static void set_all_global_config_variables(void)
|
||||
static int check_preinit_isolated_config(int preinit)
|
||||
{
|
||||
TyStatus status;
|
||||
PyPreConfig *rt_preconfig;
|
||||
TyPreConfig *rt_preconfig;
|
||||
|
||||
/* environment variables must be ignored */
|
||||
set_all_env_vars();
|
||||
@@ -1084,7 +1084,7 @@ static int check_preinit_isolated_config(int preinit)
|
||||
set_all_global_config_variables();
|
||||
|
||||
if (preinit) {
|
||||
PyPreConfig preconfig;
|
||||
TyPreConfig preconfig;
|
||||
TyPreConfig_InitIsolatedConfig(&preconfig);
|
||||
|
||||
status = Ty_PreInitialize(&preconfig);
|
||||
@@ -1141,7 +1141,7 @@ static int check_init_python_config(int preinit)
|
||||
#endif
|
||||
|
||||
if (preinit) {
|
||||
PyPreConfig preconfig;
|
||||
TyPreConfig preconfig;
|
||||
TyPreConfig_InitPythonConfig(&preconfig);
|
||||
|
||||
TyStatus status = Ty_PreInitialize(&preconfig);
|
||||
@@ -1176,7 +1176,7 @@ static int test_init_python_config(void)
|
||||
|
||||
static int test_init_dont_configure_locale(void)
|
||||
{
|
||||
PyPreConfig preconfig;
|
||||
TyPreConfig preconfig;
|
||||
TyPreConfig_InitPythonConfig(&preconfig);
|
||||
|
||||
preconfig.configure_locale = 0;
|
||||
@@ -1638,7 +1638,7 @@ static int test_init_setpath(void)
|
||||
|
||||
static int test_init_setpath_config(void)
|
||||
{
|
||||
PyPreConfig preconfig;
|
||||
TyPreConfig preconfig;
|
||||
TyPreConfig_InitPythonConfig(&preconfig);
|
||||
|
||||
/* Explicitly preinitializes with Python preconfiguration to avoid
|
||||
@@ -1881,7 +1881,7 @@ static int test_initconfig_get_api(void)
|
||||
assert(TyInitConfig_SetInt(config, "dev_mode", 1) == 0);
|
||||
assert(initconfig_getint(config, "dev_mode") == 1);
|
||||
|
||||
// test TyInitConfig_GetInt() on a PyPreConfig option
|
||||
// test TyInitConfig_GetInt() on a TyPreConfig option
|
||||
assert(initconfig_getint(config, "utf8_mode") == 0);
|
||||
assert(TyInitConfig_SetInt(config, "utf8_mode", 1) == 0);
|
||||
assert(initconfig_getint(config, "utf8_mode") == 1);
|
||||
|
||||
6
Python/executor_cases.c.h
generated
6
Python/executor_cases.c.h
generated
@@ -810,7 +810,7 @@
|
||||
value = stack_pointer[-1];
|
||||
STAT_INC(TO_BOOL, hit);
|
||||
TyObject *value_o = PyStackRef_AsPyObjectBorrow(value);
|
||||
if (value_o == &_Py_STR(empty)) {
|
||||
if (value_o == &_Ty_STR(empty)) {
|
||||
assert(_Py_IsImmortal(value_o));
|
||||
res = PyStackRef_False;
|
||||
}
|
||||
@@ -2629,7 +2629,7 @@
|
||||
assert(WITHIN_STACK_BOUNDS());
|
||||
JUMP_TO_ERROR();
|
||||
}
|
||||
TyObject *str_o = _TyUnicode_JoinArray(&_Py_STR(empty), pieces_o, oparg);
|
||||
TyObject *str_o = _TyUnicode_JoinArray(&_Ty_STR(empty), pieces_o, oparg);
|
||||
STACKREFS_TO_PYOBJECTS_CLEANUP(pieces_o);
|
||||
_TyFrame_SetStackPointer(frame, stack_pointer);
|
||||
_PyStackRef tmp;
|
||||
@@ -2668,7 +2668,7 @@
|
||||
format_o = PyStackRef_AsPyObjectBorrow(format[0]);
|
||||
}
|
||||
else {
|
||||
format_o = &_Py_STR(empty);
|
||||
format_o = &_Ty_STR(empty);
|
||||
}
|
||||
_TyFrame_SetStackPointer(frame, stack_pointer);
|
||||
TyObject *interpolation_o = _PyInterpolation_Build(value_o, str_o, conversion, format_o);
|
||||
|
||||
@@ -203,7 +203,7 @@ static const PyConfigSpec PYCONFIG_SPEC[] = {
|
||||
|
||||
#undef SPEC
|
||||
#define SPEC(MEMBER, TYPE, VISIBILITY) \
|
||||
{#MEMBER, offsetof(PyPreConfig, MEMBER), PyConfig_MEMBER_##TYPE, \
|
||||
{#MEMBER, offsetof(TyPreConfig, MEMBER), PyConfig_MEMBER_##TYPE, \
|
||||
PyConfig_MEMBER_##VISIBILITY, NO_SYS}
|
||||
|
||||
static const PyConfigSpec PYPRECONFIG_SPEC[] = {
|
||||
@@ -1220,7 +1220,7 @@ config_get_spec_member(const PyConfig *config, const PyConfigSpec *spec)
|
||||
|
||||
|
||||
static inline void*
|
||||
preconfig_get_spec_member(const PyPreConfig *preconfig, const PyConfigSpec *spec)
|
||||
preconfig_get_spec_member(const TyPreConfig *preconfig, const PyConfigSpec *spec)
|
||||
{
|
||||
return (char *)preconfig + spec->offset;
|
||||
}
|
||||
@@ -2375,7 +2375,7 @@ config_read_complex_options(PyConfig *config)
|
||||
|
||||
|
||||
static const wchar_t *
|
||||
config_get_stdio_errors(const PyPreConfig *preconfig)
|
||||
config_get_stdio_errors(const TyPreConfig *preconfig)
|
||||
{
|
||||
if (preconfig->utf8_mode) {
|
||||
/* UTF-8 Mode uses UTF-8/surrogateescape */
|
||||
@@ -2408,7 +2408,7 @@ config_get_stdio_errors(const PyPreConfig *preconfig)
|
||||
|
||||
// See also config_get_fs_encoding()
|
||||
static TyStatus
|
||||
config_get_locale_encoding(PyConfig *config, const PyPreConfig *preconfig,
|
||||
config_get_locale_encoding(PyConfig *config, const TyPreConfig *preconfig,
|
||||
wchar_t **locale_encoding)
|
||||
{
|
||||
wchar_t *encoding;
|
||||
@@ -2429,7 +2429,7 @@ config_get_locale_encoding(PyConfig *config, const PyPreConfig *preconfig,
|
||||
|
||||
static TyStatus
|
||||
config_init_stdio_encoding(PyConfig *config,
|
||||
const PyPreConfig *preconfig)
|
||||
const TyPreConfig *preconfig)
|
||||
{
|
||||
TyStatus status;
|
||||
|
||||
@@ -2513,7 +2513,7 @@ config_init_stdio_encoding(PyConfig *config,
|
||||
|
||||
// See also config_get_locale_encoding()
|
||||
static TyStatus
|
||||
config_get_fs_encoding(PyConfig *config, const PyPreConfig *preconfig,
|
||||
config_get_fs_encoding(PyConfig *config, const TyPreConfig *preconfig,
|
||||
wchar_t **fs_encoding)
|
||||
{
|
||||
#ifdef _Ty_FORCE_UTF8_FS_ENCODING
|
||||
@@ -2544,7 +2544,7 @@ config_get_fs_encoding(PyConfig *config, const PyPreConfig *preconfig,
|
||||
|
||||
|
||||
static TyStatus
|
||||
config_init_fs_encoding(PyConfig *config, const PyPreConfig *preconfig)
|
||||
config_init_fs_encoding(PyConfig *config, const TyPreConfig *preconfig)
|
||||
{
|
||||
TyStatus status;
|
||||
|
||||
@@ -2634,7 +2634,7 @@ static TyStatus
|
||||
config_read(PyConfig *config, int compute_path_config)
|
||||
{
|
||||
TyStatus status;
|
||||
const PyPreConfig *preconfig = &_PyRuntime.preconfig;
|
||||
const TyPreConfig *preconfig = &_PyRuntime.preconfig;
|
||||
|
||||
if (config->use_environment) {
|
||||
status = config_read_env_vars(config);
|
||||
@@ -2796,7 +2796,7 @@ _TyConfig_Write(const PyConfig *config, _PyRuntimeState *runtime)
|
||||
}
|
||||
|
||||
/* Write the new pre-configuration into _PyRuntime */
|
||||
PyPreConfig *preconfig = &runtime->preconfig;
|
||||
TyPreConfig *preconfig = &runtime->preconfig;
|
||||
preconfig->isolated = config->isolated;
|
||||
preconfig->use_environment = config->use_environment;
|
||||
preconfig->dev_mode = config->dev_mode;
|
||||
@@ -3281,7 +3281,7 @@ core_read_precmdline(PyConfig *config, _PyPreCmdline *precmdline)
|
||||
}
|
||||
}
|
||||
|
||||
PyPreConfig preconfig;
|
||||
TyPreConfig preconfig;
|
||||
|
||||
status = _TyPreConfig_InitFromPreConfig(&preconfig, &_PyRuntime.preconfig);
|
||||
if (_TyStatus_EXCEPTION(status)) {
|
||||
@@ -3553,7 +3553,7 @@ _Ty_GetConfigsAsDict(void)
|
||||
|
||||
/* pre config */
|
||||
TyInterpreterState *interp = _TyInterpreterState_GET();
|
||||
const PyPreConfig *pre_config = &interp->runtime->preconfig;
|
||||
const TyPreConfig *pre_config = &interp->runtime->preconfig;
|
||||
dict = _TyPreConfig_AsDict(pre_config);
|
||||
if (dict == NULL) {
|
||||
goto error;
|
||||
@@ -3690,7 +3690,7 @@ _Ty_DumpPathConfig(TyThreadState *tstate)
|
||||
// --- PyInitConfig API ---------------------------------------------------
|
||||
|
||||
struct PyInitConfig {
|
||||
PyPreConfig preconfig;
|
||||
TyPreConfig preconfig;
|
||||
PyConfig config;
|
||||
struct _inittab *inittab;
|
||||
Ty_ssize_t inittab_size;
|
||||
@@ -4383,7 +4383,7 @@ config_get(const PyConfig *config, const PyConfigSpec *spec,
|
||||
|
||||
|
||||
static TyObject*
|
||||
preconfig_get(const PyPreConfig *preconfig, const PyConfigSpec *spec)
|
||||
preconfig_get(const TyPreConfig *preconfig, const PyConfigSpec *spec)
|
||||
{
|
||||
// The type of all PYPRECONFIG_SPEC members is INT or BOOL.
|
||||
assert(spec->type == PyConfig_MEMBER_INT
|
||||
@@ -4419,7 +4419,7 @@ PyConfig_Get(const char *name)
|
||||
|
||||
spec = preconfig_find_spec(name);
|
||||
if (spec != NULL) {
|
||||
const PyPreConfig *preconfig = &_PyRuntime.preconfig;
|
||||
const TyPreConfig *preconfig = &_PyRuntime.preconfig;
|
||||
return preconfig_get(preconfig, spec);
|
||||
}
|
||||
|
||||
|
||||
@@ -512,7 +512,7 @@ _Py_uop_sym_truthiness(JitOptContext *ctx, JitOptSymbol *sym)
|
||||
return !_TyLong_IsZero((PyLongObject *)value);
|
||||
}
|
||||
if (tp == &TyUnicode_Type) {
|
||||
return value != &_Py_STR(empty);
|
||||
return value != &_Ty_STR(empty);
|
||||
}
|
||||
if (tp == &TyBool_Type) {
|
||||
return value == Ty_True;
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
|
||||
/* Forward declarations */
|
||||
static void
|
||||
preconfig_copy(PyPreConfig *config, const PyPreConfig *config2);
|
||||
preconfig_copy(TyPreConfig *config, const TyPreConfig *config2);
|
||||
|
||||
|
||||
/* --- File system encoding/errors -------------------------------- */
|
||||
@@ -129,7 +129,7 @@ _PyPreCmdline_SetArgv(_PyPreCmdline *cmdline, const _PyArgv *args)
|
||||
|
||||
|
||||
static void
|
||||
precmdline_get_preconfig(_PyPreCmdline *cmdline, const PyPreConfig *config)
|
||||
precmdline_get_preconfig(_PyPreCmdline *cmdline, const TyPreConfig *config)
|
||||
{
|
||||
#define COPY_ATTR(ATTR) \
|
||||
if (config->ATTR != -1) { \
|
||||
@@ -145,7 +145,7 @@ precmdline_get_preconfig(_PyPreCmdline *cmdline, const PyPreConfig *config)
|
||||
|
||||
|
||||
static void
|
||||
precmdline_set_preconfig(const _PyPreCmdline *cmdline, PyPreConfig *config)
|
||||
precmdline_set_preconfig(const _PyPreCmdline *cmdline, TyPreConfig *config)
|
||||
{
|
||||
#define COPY_ATTR(ATTR) \
|
||||
config->ATTR = cmdline->ATTR
|
||||
@@ -228,7 +228,7 @@ precmdline_parse_cmdline(_PyPreCmdline *cmdline)
|
||||
|
||||
|
||||
TyStatus
|
||||
_PyPreCmdline_Read(_PyPreCmdline *cmdline, const PyPreConfig *preconfig)
|
||||
_PyPreCmdline_Read(_PyPreCmdline *cmdline, const TyPreConfig *preconfig)
|
||||
{
|
||||
precmdline_get_preconfig(cmdline, preconfig);
|
||||
|
||||
@@ -277,11 +277,11 @@ _PyPreCmdline_Read(_PyPreCmdline *cmdline, const PyPreConfig *preconfig)
|
||||
}
|
||||
|
||||
|
||||
/* --- PyPreConfig ----------------------------------------------- */
|
||||
/* --- TyPreConfig ----------------------------------------------- */
|
||||
|
||||
|
||||
void
|
||||
_TyPreConfig_InitCompatConfig(PyPreConfig *config)
|
||||
_TyPreConfig_InitCompatConfig(TyPreConfig *config)
|
||||
{
|
||||
memset(config, 0, sizeof(*config));
|
||||
|
||||
@@ -309,7 +309,7 @@ _TyPreConfig_InitCompatConfig(PyPreConfig *config)
|
||||
|
||||
|
||||
void
|
||||
TyPreConfig_InitPythonConfig(PyPreConfig *config)
|
||||
TyPreConfig_InitPythonConfig(TyPreConfig *config)
|
||||
{
|
||||
_TyPreConfig_InitCompatConfig(config);
|
||||
|
||||
@@ -330,7 +330,7 @@ TyPreConfig_InitPythonConfig(PyPreConfig *config)
|
||||
|
||||
|
||||
void
|
||||
TyPreConfig_InitIsolatedConfig(PyPreConfig *config)
|
||||
TyPreConfig_InitIsolatedConfig(TyPreConfig *config)
|
||||
{
|
||||
_TyPreConfig_InitCompatConfig(config);
|
||||
|
||||
@@ -347,8 +347,8 @@ TyPreConfig_InitIsolatedConfig(PyPreConfig *config)
|
||||
|
||||
|
||||
TyStatus
|
||||
_TyPreConfig_InitFromPreConfig(PyPreConfig *config,
|
||||
const PyPreConfig *config2)
|
||||
_TyPreConfig_InitFromPreConfig(TyPreConfig *config,
|
||||
const TyPreConfig *config2)
|
||||
{
|
||||
TyPreConfig_InitPythonConfig(config);
|
||||
preconfig_copy(config, config2);
|
||||
@@ -357,7 +357,7 @@ _TyPreConfig_InitFromPreConfig(PyPreConfig *config,
|
||||
|
||||
|
||||
void
|
||||
_TyPreConfig_InitFromConfig(PyPreConfig *preconfig, const PyConfig *config)
|
||||
_TyPreConfig_InitFromConfig(TyPreConfig *preconfig, const PyConfig *config)
|
||||
{
|
||||
_PyConfigInitEnum config_init = (_PyConfigInitEnum)config->_config_init;
|
||||
switch (config_init) {
|
||||
@@ -377,7 +377,7 @@ _TyPreConfig_InitFromConfig(PyPreConfig *preconfig, const PyConfig *config)
|
||||
|
||||
|
||||
static void
|
||||
preconfig_copy(PyPreConfig *config, const PyPreConfig *config2)
|
||||
preconfig_copy(TyPreConfig *config, const TyPreConfig *config2)
|
||||
{
|
||||
#define COPY_ATTR(ATTR) config->ATTR = config2->ATTR
|
||||
|
||||
@@ -400,7 +400,7 @@ preconfig_copy(PyPreConfig *config, const PyPreConfig *config2)
|
||||
|
||||
|
||||
TyObject*
|
||||
_TyPreConfig_AsDict(const PyPreConfig *config)
|
||||
_TyPreConfig_AsDict(const TyPreConfig *config)
|
||||
{
|
||||
TyObject *dict;
|
||||
|
||||
@@ -446,7 +446,7 @@ fail:
|
||||
|
||||
|
||||
void
|
||||
_TyPreConfig_GetConfig(PyPreConfig *preconfig, const PyConfig *config)
|
||||
_TyPreConfig_GetConfig(TyPreConfig *preconfig, const PyConfig *config)
|
||||
{
|
||||
#define COPY_ATTR(ATTR) \
|
||||
if (config->ATTR != -1) { \
|
||||
@@ -463,7 +463,7 @@ _TyPreConfig_GetConfig(PyPreConfig *preconfig, const PyConfig *config)
|
||||
|
||||
|
||||
static void
|
||||
preconfig_get_global_vars(PyPreConfig *config)
|
||||
preconfig_get_global_vars(TyPreConfig *config)
|
||||
{
|
||||
if (config->_config_init != _TyConfig_INIT_COMPAT) {
|
||||
/* Python and Isolated configuration ignore global variables */
|
||||
@@ -497,7 +497,7 @@ _Ty_COMP_DIAG_POP
|
||||
|
||||
|
||||
static void
|
||||
preconfig_set_global_vars(const PyPreConfig *config)
|
||||
preconfig_set_global_vars(const TyPreConfig *config)
|
||||
{
|
||||
#define COPY_FLAG(ATTR, VAR) \
|
||||
if (config->ATTR >= 0) { \
|
||||
@@ -600,7 +600,7 @@ _Ty_get_xoption(const PyWideStringList *xoptions, const wchar_t *name)
|
||||
|
||||
|
||||
static TyStatus
|
||||
preconfig_init_utf8_mode(PyPreConfig *config, const _PyPreCmdline *cmdline)
|
||||
preconfig_init_utf8_mode(TyPreConfig *config, const _PyPreCmdline *cmdline)
|
||||
{
|
||||
#ifdef MS_WINDOWS
|
||||
if (config->legacy_windows_fs_encoding) {
|
||||
@@ -671,7 +671,7 @@ preconfig_init_utf8_mode(PyPreConfig *config, const _PyPreCmdline *cmdline)
|
||||
|
||||
|
||||
static void
|
||||
preconfig_init_coerce_c_locale(PyPreConfig *config)
|
||||
preconfig_init_coerce_c_locale(TyPreConfig *config)
|
||||
{
|
||||
if (!config->configure_locale) {
|
||||
config->coerce_c_locale = 0;
|
||||
@@ -718,7 +718,7 @@ preconfig_init_coerce_c_locale(PyPreConfig *config)
|
||||
|
||||
|
||||
static TyStatus
|
||||
preconfig_init_allocator(PyPreConfig *config)
|
||||
preconfig_init_allocator(TyPreConfig *config)
|
||||
{
|
||||
if (config->allocator == PYMEM_ALLOCATOR_NOT_SET) {
|
||||
/* bpo-34247. The PYTHONMALLOC environment variable has the priority
|
||||
@@ -743,7 +743,7 @@ preconfig_init_allocator(PyPreConfig *config)
|
||||
|
||||
|
||||
static TyStatus
|
||||
preconfig_read(PyPreConfig *config, _PyPreCmdline *cmdline)
|
||||
preconfig_read(TyPreConfig *config, _PyPreCmdline *cmdline)
|
||||
{
|
||||
TyStatus status;
|
||||
|
||||
@@ -795,7 +795,7 @@ preconfig_read(PyPreConfig *config, _PyPreCmdline *cmdline)
|
||||
- Ty_xxx global configuration variables
|
||||
- the LC_CTYPE locale */
|
||||
TyStatus
|
||||
_TyPreConfig_Read(PyPreConfig *config, const _PyArgv *args)
|
||||
_TyPreConfig_Read(TyPreConfig *config, const _PyArgv *args)
|
||||
{
|
||||
TyStatus status;
|
||||
|
||||
@@ -817,7 +817,7 @@ _TyPreConfig_Read(PyPreConfig *config, const _PyArgv *args)
|
||||
}
|
||||
|
||||
/* Save the config to be able to restore it if encodings change */
|
||||
PyPreConfig save_config;
|
||||
TyPreConfig save_config;
|
||||
|
||||
status = _TyPreConfig_InitFromPreConfig(&save_config, config);
|
||||
if (_TyStatus_EXCEPTION(status)) {
|
||||
@@ -829,7 +829,7 @@ _TyPreConfig_Read(PyPreConfig *config, const _PyArgv *args)
|
||||
_Ty_SetLocaleFromEnv(LC_CTYPE);
|
||||
}
|
||||
|
||||
PyPreConfig save_runtime_config;
|
||||
TyPreConfig save_runtime_config;
|
||||
preconfig_copy(&save_runtime_config, &_PyRuntime.preconfig);
|
||||
|
||||
_PyPreCmdline cmdline = _PyPreCmdline_INIT;
|
||||
@@ -935,9 +935,9 @@ done:
|
||||
Do nothing if called after Ty_Initialize(): ignore the new
|
||||
pre-configuration. */
|
||||
TyStatus
|
||||
_TyPreConfig_Write(const PyPreConfig *src_config)
|
||||
_TyPreConfig_Write(const TyPreConfig *src_config)
|
||||
{
|
||||
PyPreConfig config;
|
||||
TyPreConfig config;
|
||||
|
||||
TyStatus status = _TyPreConfig_InitFromPreConfig(&config, src_config);
|
||||
if (_TyStatus_EXCEPTION(status)) {
|
||||
|
||||
@@ -226,7 +226,7 @@ static const char *_C_LOCALE_WARNING =
|
||||
static void
|
||||
emit_stderr_warning_for_legacy_locale(_PyRuntimeState *runtime)
|
||||
{
|
||||
const PyPreConfig *preconfig = &runtime->preconfig;
|
||||
const TyPreConfig *preconfig = &runtime->preconfig;
|
||||
if (preconfig->coerce_c_locale_warn && _Ty_LegacyLocaleDetected(1)) {
|
||||
TySys_FormatStderr("%s", _C_LOCALE_WARNING);
|
||||
}
|
||||
@@ -963,7 +963,7 @@ pyinit_config(_PyRuntimeState *runtime,
|
||||
|
||||
|
||||
TyStatus
|
||||
_Ty_PreInitializeFromPyArgv(const PyPreConfig *src_config, const _PyArgv *args)
|
||||
_Ty_PreInitializeFromPyArgv(const TyPreConfig *src_config, const _PyArgv *args)
|
||||
{
|
||||
TyStatus status;
|
||||
|
||||
@@ -986,7 +986,7 @@ _Ty_PreInitializeFromPyArgv(const PyPreConfig *src_config, const _PyArgv *args)
|
||||
at exit on success. */
|
||||
runtime->preinitializing = 1;
|
||||
|
||||
PyPreConfig config;
|
||||
TyPreConfig config;
|
||||
|
||||
status = _TyPreConfig_InitFromPreConfig(&config, src_config);
|
||||
if (_TyStatus_EXCEPTION(status)) {
|
||||
@@ -1010,7 +1010,7 @@ _Ty_PreInitializeFromPyArgv(const PyPreConfig *src_config, const _PyArgv *args)
|
||||
|
||||
|
||||
TyStatus
|
||||
Ty_PreInitializeFromBytesArgs(const PyPreConfig *src_config, Ty_ssize_t argc, char **argv)
|
||||
Ty_PreInitializeFromBytesArgs(const TyPreConfig *src_config, Ty_ssize_t argc, char **argv)
|
||||
{
|
||||
_PyArgv args = {.use_bytes_argv = 1, .argc = argc, .bytes_argv = argv};
|
||||
return _Ty_PreInitializeFromPyArgv(src_config, &args);
|
||||
@@ -1018,7 +1018,7 @@ Ty_PreInitializeFromBytesArgs(const PyPreConfig *src_config, Ty_ssize_t argc, ch
|
||||
|
||||
|
||||
TyStatus
|
||||
Ty_PreInitializeFromArgs(const PyPreConfig *src_config, Ty_ssize_t argc, wchar_t **argv)
|
||||
Ty_PreInitializeFromArgs(const TyPreConfig *src_config, Ty_ssize_t argc, wchar_t **argv)
|
||||
{
|
||||
_PyArgv args = {.use_bytes_argv = 0, .argc = argc, .wchar_argv = argv};
|
||||
return _Ty_PreInitializeFromPyArgv(src_config, &args);
|
||||
@@ -1026,7 +1026,7 @@ Ty_PreInitializeFromArgs(const PyPreConfig *src_config, Ty_ssize_t argc, wchar_t
|
||||
|
||||
|
||||
TyStatus
|
||||
Ty_PreInitialize(const PyPreConfig *src_config)
|
||||
Ty_PreInitialize(const TyPreConfig *src_config)
|
||||
{
|
||||
return _Ty_PreInitializeFromPyArgv(src_config, NULL);
|
||||
}
|
||||
@@ -1049,7 +1049,7 @@ _Ty_PreInitializeFromConfig(const PyConfig *config,
|
||||
return _TyStatus_OK();
|
||||
}
|
||||
|
||||
PyPreConfig preconfig;
|
||||
TyPreConfig preconfig;
|
||||
|
||||
_TyPreConfig_InitFromConfig(&preconfig, config);
|
||||
|
||||
|
||||
@@ -3405,7 +3405,7 @@ _TySys_SetFlagInt(Ty_ssize_t pos, int value)
|
||||
static int
|
||||
set_flags_from_config(TyInterpreterState *interp, TyObject *flags)
|
||||
{
|
||||
const PyPreConfig *preconfig = &interp->runtime->preconfig;
|
||||
const TyPreConfig *preconfig = &interp->runtime->preconfig;
|
||||
const PyConfig *config = _TyInterpreterState_GetConfig(interp);
|
||||
|
||||
// _TySys_UpdateConfig() modifies sys.flags in-place:
|
||||
|
||||
Reference in New Issue
Block a user