Checkpoint. 218 tests are okay; 53 are failing. Done so far:

- all classes are new-style (but ripping out classobject.[ch] isn't done)
- int/int -> float
- all exceptions must derive from BaseException
- absolute import
- 'as' and 'with' are keywords
This commit is contained in:
Guido van Rossum 2006-03-15 04:58:47 +00:00
parent f3175f6341
commit 45aecf451a
24 changed files with 87 additions and 6365 deletions

View file

@ -2,7 +2,6 @@
#include "Python.h"
#include "osdefs.h"
#include "code.h" /* For CO_FUTURE_DIVISION */
#include "import.h"
#ifdef __VMS
@ -34,7 +33,7 @@ static char **orig_argv;
static int orig_argc;
/* command line options */
#define BASE_OPTS "c:dEhim:OQ:StuUvVW:xX"
#define BASE_OPTS "c:dEhim:OStuvVW:xX"
#ifndef RISCOS
#define PROGRAM_OPTS BASE_OPTS
@ -64,7 +63,6 @@ static char *usage_2 = "\
-m mod : run library module as a script (terminates option list)\n\
-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\
-u : unbuffered binary stdout and stderr (also PYTHONUNBUFFERED=x)\n\
@ -220,33 +218,6 @@ Py_Main(int argc, char **argv)
Py_DebugFlag++;
break;
case 'Q':
if (strcmp(_PyOS_optarg, "old") == 0) {
Py_DivisionWarningFlag = 0;
break;
}
if (strcmp(_PyOS_optarg, "warn") == 0) {
Py_DivisionWarningFlag = 1;
break;
}
if (strcmp(_PyOS_optarg, "warnall") == 0) {
Py_DivisionWarningFlag = 2;
break;
}
if (strcmp(_PyOS_optarg, "new") == 0) {
/* This only affects __main__ */
cf.cf_flags |= CO_FUTURE_DIVISION;
/* And this tells the eval loop to treat
BINARY_DIVIDE as BINARY_TRUE_DIVIDE */
_Py_QnewFlag = 1;
break;
}
fprintf(stderr,
"-Q option should be `-Qold', "
"`-Qwarn', `-Qwarnall', or `-Qnew' only\n");
return usage(2, argv[0]);
/* NOTREACHED */
case 'i':
inspect++;
saw_inspect_flag = 1;
@ -288,12 +259,10 @@ Py_Main(int argc, char **argv)
skipfirstline = 1;
break;
case 'U':
Py_UnicodeFlag++;
break;
case 'h':
help++;
break;
case 'V':
version++;
break;