summaryrefslogtreecommitdiffstats
path: root/Python/preconfig.c
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@redhat.com>2019-05-01 03:35:33 (GMT)
committerGitHub <noreply@github.com>2019-05-01 03:35:33 (GMT)
commitdb7197543112954b0912e3d46e39fefcb1c3b950 (patch)
tree0c82232775c6b1a03671054f9e70f2bb99e6adc9 /Python/preconfig.c
parentc4e671eec20dfcb29b18596a89ef075f826c9f96 (diff)
downloadcpython-db7197543112954b0912e3d46e39fefcb1c3b950.zip
cpython-db7197543112954b0912e3d46e39fefcb1c3b950.tar.gz
cpython-db7197543112954b0912e3d46e39fefcb1c3b950.tar.bz2
bpo-36763: Rework _PyInitError API (GH-13031)
* Remove _PyInitError.user_err field and _Py_INIT_USER_ERR() macro: use _Py_INIT_ERR() instead. _Py_ExitInitError() now longer calls abort() on error: exit with exit code 1 instead. * Add _PyInitError._type private field. * exitcode field type is now unsigned int on Windows. * Rename prefix field to _func. * Rename msg field to err_msg.
Diffstat (limited to 'Python/preconfig.c')
-rw-r--r--Python/preconfig.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/Python/preconfig.c b/Python/preconfig.c
index 78377cf..108cbc6 100644
--- a/Python/preconfig.c
+++ b/Python/preconfig.c
@@ -7,7 +7,7 @@
#define DECODE_LOCALE_ERR(NAME, LEN) \
(((LEN) == -2) \
- ? _Py_INIT_USER_ERR("cannot decode " NAME) \
+ ? _Py_INIT_ERR("cannot decode " NAME) \
: _Py_INIT_NO_MEMORY())
@@ -526,7 +526,7 @@ preconfig_init_utf8_mode(_PyPreConfig *config, const _PyPreCmdline *cmdline)
config->utf8_mode = 0;
}
else {
- return _Py_INIT_USER_ERR("invalid -X utf8 option value");
+ return _Py_INIT_ERR("invalid -X utf8 option value");
}
}
else {
@@ -544,8 +544,8 @@ preconfig_init_utf8_mode(_PyPreConfig *config, const _PyPreCmdline *cmdline)
config->utf8_mode = 0;
}
else {
- return _Py_INIT_USER_ERR("invalid PYTHONUTF8 environment "
- "variable value");
+ return _Py_INIT_ERR("invalid PYTHONUTF8 environment "
+ "variable value");
}
return _Py_INIT_OK();
}
@@ -831,7 +831,7 @@ _PyPreConfig_SetAllocator(_PyPreConfig *config)
PyMem_GetAllocator(PYMEM_DOMAIN_RAW, &old_alloc);
if (_PyMem_SetupAllocators(config->allocator) < 0) {
- return _Py_INIT_USER_ERR("Unknown PYTHONMALLOC allocator");
+ return _Py_INIT_ERR("Unknown PYTHONMALLOC allocator");
}
/* Copy the pre-configuration with the new allocator */