diff options
author | Neal Norwitz <nnorwitz@gmail.com> | 2007-05-23 06:35:32 +0000 |
---|---|---|
committer | Neal Norwitz <nnorwitz@gmail.com> | 2007-05-23 06:35:32 +0000 |
commit | 8b2bfbc198c1fe0dcdfd42cc4683879cd712ccfd (patch) | |
tree | 9f3e2eed06cc877197eaadc398fb0bd12f5b9db3 /Modules/main.c | |
parent | 5f2ba9f2b1d5bd7ce9a6388dc58624403ca54547 (diff) | |
download | cpython-git-8b2bfbc198c1fe0dcdfd42cc4683879cd712ccfd.tar.gz |
Add -3 option to the interpreter to warn about features that are
deprecated and will be changed/removed in Python 3.0.
This patch is mostly from Anthony. I tweaked some format and added
a little doc.
Diffstat (limited to 'Modules/main.c')
-rw-r--r-- | Modules/main.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/Modules/main.c b/Modules/main.c index 2dbdfe9ab1..7777db1a96 100644 --- a/Modules/main.c +++ b/Modules/main.c @@ -40,7 +40,7 @@ static char **orig_argv; static int orig_argc; /* command line options */ -#define BASE_OPTS "c:dEhim:OQ:StuUvVW:xX?" +#define BASE_OPTS "3c:dEhim:OQ:StuUvVW:xX?" #ifndef RISCOS #define PROGRAM_OPTS BASE_OPTS @@ -82,6 +82,7 @@ static char *usage_3 = "\ -V : print the Python version number and exit (also --version)\n\ -W arg : warning control; arg is action:message:category:module:lineno\n\ -x : skip first line of source, allowing use of non-Unix forms of #!cmd\n\ +-3 : warn about Python 3.x incompatibilities\n\ file : program read from script file\n\ - : program read from stdin (default; interactive mode if a tty)\n\ "; @@ -267,6 +268,10 @@ Py_Main(int argc, char **argv) Py_DebugFlag++; break; + case '3': + Py_Py3kWarningFlag++; + break; + case 'Q': if (strcmp(_PyOS_optarg, "old") == 0) { Py_DivisionWarningFlag = 0; |