Skip to content

Commit

Permalink
(Merge 3.2) main() now displays an error message before exiting if a …
Browse files Browse the repository at this point in the history
…command

line argument cannot be decoded
  • Loading branch information
Victor Stinner committed Dec 16, 2011
2 parents 1637487 + 94ba691 commit 3607e3d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Modules/python.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,12 @@ main(int argc, char **argv)
#else
argv_copy[i] = _Py_char2wchar(argv[i], NULL);
#endif
if (!argv_copy[i])
if (!argv_copy[i]) {
fprintf(stderr, "Fatal Python error: "
"unable to decode the command line argument #%i\n",
i + 1);
return 1;
}
argv_copy2[i] = argv_copy[i];
}
setlocale(LC_ALL, oldloc);
Expand Down

0 comments on commit 3607e3d

Please sign in to comment.