summaryrefslogtreecommitdiffstats
path: root/Modules/main.c
diff options
context:
space:
mode:
authorEzio Melotti <ezio.melotti@gmail.com>2012-11-23 16:46:11 (GMT)
committerEzio Melotti <ezio.melotti@gmail.com>2012-11-23 16:46:11 (GMT)
commitec6486d52d89cea1362697dd0d92e127c188d298 (patch)
treed90ba79332f504ea7997f176a723a707af6936ce /Modules/main.c
parent0afe4e4fa6df2acc46de6e826de06b9f343de7f1 (diff)
downloadcpython-ec6486d52d89cea1362697dd0d92e127c188d298.zip
cpython-ec6486d52d89cea1362697dd0d92e127c188d298.tar.gz
cpython-ec6486d52d89cea1362697dd0d92e127c188d298.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 1ce7c8f..ef9b245 100644
--- a/Modules/main.c
+++ b/Modules/main.c
@@ -264,6 +264,7 @@ Py_Main(int argc, char **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