mirror of
https://github.com/python/cpython.git
synced 2025-07-16 15:55:18 +00:00
main(): catch PyUnicode_FromString() failure (exit)
This commit is contained in:
parent
ee85a1d3bb
commit
a21350976e
1 changed files with 2 additions and 0 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue