diff options
Diffstat (limited to 'Python/preconfig.c')
-rw-r--r-- | Python/preconfig.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/Python/preconfig.c b/Python/preconfig.c index ae1cc3f90f..d59273159a 100644 --- a/Python/preconfig.c +++ b/Python/preconfig.c @@ -1,4 +1,5 @@ #include "Python.h" +#include "pycore_fileutils.h" // DECODE_LOCALE_ERR #include "pycore_getopt.h" // _PyOS_GetOpt() #include "pycore_initconfig.h" // _PyArgv #include "pycore_pymem.h" // _PyMem_GetAllocatorName() @@ -6,12 +7,6 @@ #include <locale.h> // setlocale() -#define DECODE_LOCALE_ERR(NAME, LEN) \ - (((LEN) == -2) \ - ? _PyStatus_ERR("cannot decode " NAME) \ - : _PyStatus_NO_MEMORY()) - - /* Forward declarations */ static void preconfig_copy(PyPreConfig *config, const PyPreConfig *config2); @@ -87,8 +82,7 @@ _PyArgv_AsWstrList(const _PyArgv *args, PyWideStringList *list) wchar_t *arg = Py_DecodeLocale(args->bytes_argv[i], &len); if (arg == NULL) { _PyWideStringList_Clear(&wargv); - return DECODE_LOCALE_ERR("command line arguments", - (Py_ssize_t)len); + return DECODE_LOCALE_ERR("command line arguments", len); } wargv.items[i] = arg; wargv.length++; |