summaryrefslogtreecommitdiffstats
path: root/Modules/main.c
diff options
context:
space:
mode:
authorEzio Melotti <ezio.melotti@gmail.com>2012-11-23 16:48:32 (GMT)
committerEzio Melotti <ezio.melotti@gmail.com>2012-11-23 16:48:32 (GMT)
commita0dd22e5e824195e322cb417ebb34c66475e952d (patch)
treee956848fbcae719625590663cbef64c6401d124e /Modules/main.c
parent3c76aa6b234fb1496b35488f30cca2fece467354 (diff)
downloadcpython-a0dd22e5e824195e322cb417ebb34c66475e952d.zip
cpython-a0dd22e5e824195e322cb417ebb34c66475e952d.tar.gz
cpython-a0dd22e5e824195e322cb417ebb34c66475e952d.tar.bz2
#16306: report only the first unknown option and add more tests. Patch by Serhiy Storchaka.
Diffstat (limited to 'Modules/main.c')
-rw-r--r--Modules/main.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/Modules/main.c b/Modules/main.c
index 5d1d896..17aebae 100644
--- a/Modules/main.c
+++ b/Modules/main.c
@@ -339,6 +339,7 @@ Py_Main(int argc, wchar_t **argv)
/* Hash randomization needed early for all string operations
(including -W and -X options). */
+ _PyOS_opterr = 0; /* prevent printing the error in 1st pass */
while ((c = _PyOS_GetOpt(argc, argv, PROGRAM_OPTS)) != EOF) {
if (c == 'm' || c == 'c') {
/* -c / -m is the last option: following arguments are