[Python-checkins] CVS: python/dist/src/Modules main.c,1.59,1.60

Guido van Rossum gvanrossum@users.sourceforge.net
2001年9月03日 20:50:06 -0700


Update of /cvsroot/python/python/dist/src/Modules
In directory usw-pr-cvs1:/tmp/cvs-serv8395
Modified Files:
	main.c 
Log Message:
PEP 238 documented -Qwarn as warning only for classic int or long
division, and this makes sense. Add -Qwarnall to warn for all
classic divisions, as required by the fixdiv.py tool.
Index: main.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Modules/main.c,v
retrieving revision 1.59
retrieving revision 1.60
diff -C2 -d -r1.59 -r1.60
*** main.c	2001年09月04日 03:25:00	1.59
--- main.c	2001年09月04日 03:50:04	1.60
***************
*** 59,63 ****
 -O : optimize generated bytecode (a tad; also PYTHONOPTIMIZE=x)\n\
 -OO : remove doc-strings in addition to the -O optimizations\n\
! -Q arg : division options: -Qold (default), -Qwarn, -Qnew\n\
 -S : don't imply 'import site' on initialization\n\
 -t : issue warnings about inconsistent tab usage (-tt: issue errors)\n\
--- 59,63 ----
 -O : optimize generated bytecode (a tad; also PYTHONOPTIMIZE=x)\n\
 -OO : remove doc-strings in addition to the -O optimizations\n\
! -Q arg : division options: -Qold (default), -Qwarn, -Qwarnall, -Qnew\n\
 -S : don't imply 'import site' on initialization\n\
 -t : issue warnings about inconsistent tab usage (-tt: issue errors)\n\
***************
*** 162,166 ****
 			}
 			if (strcmp(_PyOS_optarg, "warn") == 0) {
! 				Py_DivisionWarningFlag++;
 				break;
 			}
--- 162,170 ----
 			}
 			if (strcmp(_PyOS_optarg, "warn") == 0) {
! 				Py_DivisionWarningFlag = 1;
! 				break;
! 			}
! 			if (strcmp(_PyOS_optarg, "warnall") == 0) {
! 				Py_DivisionWarningFlag = 2;
 				break;
 			}
***************
*** 171,176 ****
 			}
 			fprintf(stderr,
! 				"-Q option should be "
! 				"`-Qold', `-Qwarn' or `-Qnew' only\n");
 			usage(2, argv[0]);
 			/* NOTREACHED */
--- 175,180 ----
 			}
 			fprintf(stderr,
! 				"-Q option should be `-Qold', "
! 				"`-Qwarn', `-Qwarnall', or `-Qnew' only\n");
 			usage(2, argv[0]);
 			/* NOTREACHED */

AltStyle によって変換されたページ (->オリジナル) /