diff options
author | Guido van Rossum <guido@python.org> | 1997-03-03 19:14:45 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1997-03-03 19:14:45 (GMT) |
commit | 7614da6b8743f1076dc68f130684b79bf4a78c0c (patch) | |
tree | 62570772c342232582cb40517b72fa423774f4a0 | |
parent | e9e47796c8138158b07a358754b28c0211de9103 (diff) | |
download | cpython-7614da6b8743f1076dc68f130684b79bf4a78c0c.zip cpython-7614da6b8743f1076dc68f130684b79bf4a78c0c.tar.gz cpython-7614da6b8743f1076dc68f130684b79bf4a78c0c.tar.bz2 |
Add -O option which sets Py_OptimizeFlag to avoid emitting SET_LINENO.
Fred: sorry, I hadn't checked these changes in. This should fix your
tracebacks!
-rw-r--r-- | Modules/main.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/Modules/main.c b/Modules/main.c index 427b19b..0cab825 100644 --- a/Modules/main.c +++ b/Modules/main.c @@ -61,7 +61,7 @@ static int orig_argc; /* Short usage message (with %s for argv0) */ static char *usage_line = -"usage: %s [-d] [-i] [-s] [-u] [-v] [-c cmd | file | -] [arg] ...\n"; +"usage: %s [-d] [-i] [-O] [-s] [-u] [-v] [-c cmd | file | -] [arg] ...\n"; /* Long usage message, split into parts < 512 bytes */ static char *usage_top = "\n\ @@ -69,6 +69,7 @@ Options and arguments (and corresponding environment variables):\n\ -d : debug output from parser (also PYTHONDEBUG=x)\n\ -i : inspect interactively after running script, (also PYTHONINSPECT=x)\n\ and force prompts, even if stdin does not appear to be a terminal.\n\ +-O : optimize generated bytecode (a tad).\n\ -s : suppress printing of top level expressions (also PYTHONSUPPRESS=x)\n\ -u : unbuffered stdout and stderr (also PYTHONUNBUFFERED=x)\n\ -v : verbose (trace import statements) (also PYTHONVERBOSE=x)\n\ @@ -118,7 +119,7 @@ main(argc, argv) if ((p = getenv("PYTHONUNBUFFERED")) && *p != '\0') unbuffered = 1; - while ((c = getopt(argc, argv, "c:disuv")) != EOF) { + while ((c = getopt(argc, argv, "c:diOsuv")) != EOF) { if (c == 'c') { /* -c is the last option; following arguments that look like options are left for the @@ -143,6 +144,10 @@ main(argc, argv) Py_InteractiveFlag++; break; + case 'O': + Py_OptimizeFlag++; + break; + case 's': Py_SuppressPrintingFlag++; break; |