main(): catch PyUnicode_FromString() failure (exit)

This commit is contained in:
Victor Stinner 2010-10-13 22:36:16 +00:00
parent ee85a1d3bb
commit a21350976e
1 changed files with 2 additions and 0 deletions

View File

@ -44,6 +44,8 @@ main(int argc, char **argv)
#ifdef __APPLE__
/* Use utf-8 on Mac OS X */
PyObject *unicode = PyUnicode_FromString(argv[i]);
if (!unicode)
return 1;
argv_copy[i] = PyUnicode_AsWideCharString(unicode, NULL);
Py_DECREF(unicode);
#else