mirror of https://github.com/python/cpython
main(): catch PyUnicode_FromString() failure (exit)
This commit is contained in:
parent
ee85a1d3bb
commit
a21350976e
|
@ -44,6 +44,8 @@ main(int argc, char **argv)
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
/* Use utf-8 on Mac OS X */
|
/* Use utf-8 on Mac OS X */
|
||||||
PyObject *unicode = PyUnicode_FromString(argv[i]);
|
PyObject *unicode = PyUnicode_FromString(argv[i]);
|
||||||
|
if (!unicode)
|
||||||
|
return 1;
|
||||||
argv_copy[i] = PyUnicode_AsWideCharString(unicode, NULL);
|
argv_copy[i] = PyUnicode_AsWideCharString(unicode, NULL);
|
||||||
Py_DECREF(unicode);
|
Py_DECREF(unicode);
|
||||||
#else
|
#else
|
||||||
|
|
Loading…
Reference in New Issue