diff options
author | Victor Stinner <victor.stinner@haypocalc.com> | 2011-12-16 22:48:55 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@haypocalc.com> | 2011-12-16 22:48:55 (GMT) |
commit | 3607e3de278c89660f773064a94385066eebda1b (patch) | |
tree | c8db1a6df2e09fcc510a301a226ec6fe0b2f451b | |
parent | 1637487a0c7f4995d7064fb7df1eab864be755d5 (diff) | |
parent | 94ba691ed34ffa1aff424876d6162b39a297e29e (diff) | |
download | cpython-3607e3de278c89660f773064a94385066eebda1b.zip cpython-3607e3de278c89660f773064a94385066eebda1b.tar.gz cpython-3607e3de278c89660f773064a94385066eebda1b.tar.bz2 |
(Merge 3.2) main() now displays an error message before exiting if a command
line argument cannot be decoded
-rw-r--r-- | Modules/python.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/Modules/python.c b/Modules/python.c index 18f9b3d..935908a 100644 --- a/Modules/python.c +++ b/Modules/python.c @@ -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); |