Index: Include/pydebug.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Include/pydebug.h,v retrieving revision 2.21 diff -c -r2.21 pydebug.h *** Include/pydebug.h 29 Jul 2002 13:42:04 -0000 2.21 --- Include/pydebug.h 12 Jan 2003 18:54:25 -0000 *************** *** 16,21 **** --- 16,22 ---- PyAPI_DATA(int) Py_UnicodeFlag; PyAPI_DATA(int) Py_IgnoreEnvironmentFlag; PyAPI_DATA(int) Py_DivisionWarningFlag; + PyAPI_DATA(int) Py_ReadOnlyBytecodeFlag; /* _XXX Py_QnewFlag should go away in 2.3. It's true iff -Qnew is passed, on the command line, and is used in 2.2 by ceval.c to make all "/" divisions true divisions (which they will be in 2.3). */ Index: Modules/main.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/main.c,v retrieving revision 1.72 diff -c -r1.72 main.c *** Modules/main.c 23 Dec 2002 21:03:36 -0000 1.72 --- Modules/main.c 12 Jan 2003 18:54:26 -0000 *************** *** 38,44 **** static int orig_argc; /* command line options */ ! #define BASE_OPTS "c:dEhiOQ:StuUvVW:xX" #ifndef RISCOS #define PROGRAM_OPTS BASE_OPTS --- 38,44 ---- static int orig_argc; /* command line options */ ! #define BASE_OPTS "c:dEhiOQ:RStuUvVW:xX" #ifndef RISCOS #define PROGRAM_OPTS BASE_OPTS *************** *** 68,88 **** -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\ see man page for details on internal buffering relating to '-u'\n\ - "; - static char *usage_3 = "\ -v : verbose (trace import statements) (also PYTHONVERBOSE=x)\n\ -V : print the Python version number and exit\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\ file : program read from script file\n\ - : program read from stdin (default; interactive mode if a tty)\n\ - "; - static char *usage_4 = "\ arg ...: arguments passed to program in sys.argv[1:]\n\ Other environment variables:\n\ PYTHONSTARTUP: file executed on interactive startup (no default)\n\ PYTHONPATH : '%c'-separated list of directories prefixed to the\n\ --- 68,91 ---- -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\ + -R : don't write .py[co] files on import\n\ -S : don't imply 'import site' on initialization\n\ + "; + static char *usage_3 = "\ -t : issue warnings about inconsistent tab usage (-tt: issue errors)\n\ -u : unbuffered binary stdout and stderr (also PYTHONUNBUFFERED=x)\n\ see man page for details on internal buffering relating to '-u'\n\ -v : verbose (trace import statements) (also PYTHONVERBOSE=x)\n\ -V : print the Python version number and exit\n\ + "; + static char *usage_4 = "\ -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\ file : program read from script file\n\ - : program read from stdin (default; interactive mode if a tty)\n\ arg ...: arguments passed to program in sys.argv[1:]\n\ + "; + static char *usage_5 = "\ Other environment variables:\n\ PYTHONSTARTUP: file executed on interactive startup (no default)\n\ PYTHONPATH : '%c'-separated list of directories prefixed to the\n\ *************** *** 105,111 **** fprintf(f, usage_1); fprintf(f, usage_2); fprintf(f, usage_3); ! fprintf(f, usage_4, DELIM, DELIM, PYTHONHOMEHELP); } #if defined(__VMS) if (exitcode == 0) { --- 108,115 ---- fprintf(f, usage_1); fprintf(f, usage_2); fprintf(f, usage_3); ! fprintf(f, usage_4); ! fprintf(f, usage_5, DELIM, DELIM, PYTHONHOMEHELP); } #if defined(__VMS) if (exitcode == 0) { *************** *** 231,236 **** --- 235,244 ---- case 'O': Py_OptimizeFlag++; + break; + + case 'R': + Py_ReadOnlyBytecodeFlag++; break; case 'S': Index: Python/import.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/import.c,v retrieving revision 2.215 diff -c -r2.215 import.c *** Python/import.c 30 Dec 2002 22:08:04 -0000 2.215 --- Python/import.c 12 Jan 2003 18:54:27 -0000 *************** *** 865,871 **** if (Py_VerboseFlag) PySys_WriteStderr("import %s # from %s\n", name, pathname); ! write_compiled_module(co, cpathname, mtime); } m = PyImport_ExecCodeModuleEx(name, (PyObject *)co, pathname); Py_DECREF(co); --- 865,872 ---- if (Py_VerboseFlag) PySys_WriteStderr("import %s # from %s\n", name, pathname); ! if (!Py_ReadOnlyBytecodeFlag) ! write_compiled_module(co, cpathname, mtime); } m = PyImport_ExecCodeModuleEx(name, (PyObject *)co, pathname); Py_DECREF(co); Index: Python/pythonrun.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/pythonrun.c,v retrieving revision 2.174 diff -c -r2.174 pythonrun.c *** Python/pythonrun.c 31 Dec 2002 03:42:12 -0000 2.174 --- Python/pythonrun.c 12 Jan 2003 18:54:28 -0000 *************** *** 51,56 **** --- 51,57 ---- int Py_VerboseFlag; /* Needed by import.c */ int Py_InteractiveFlag; /* Needed by Py_FdIsInteractive() below */ int Py_NoSiteFlag; /* Suppress 'import site' */ + int Py_ReadOnlyBytecodeFlag; /* Suppress writing bytecode files (*.py[co]) */ int Py_UseClassExceptionsFlag = 1; /* Needed by bltinmodule.c: deprecated */ int Py_FrozenFlag; /* Needed by getpath.c */ int Py_UnicodeFlag = 0; /* Needed by compile.c */