Patch #602345 by Neal Norwitz and me: add -B option and PYTHONDONTWRITEBYTECODE envvar to skip writing bytecode.
diff --git a/Doc/library/sys.rst b/Doc/library/sys.rst
index 24ce207..a98c5d4 100644
--- a/Doc/library/sys.rst
+++ b/Doc/library/sys.rst
@@ -507,6 +507,17 @@
when Python is started with the -3 option.
+.. data:: dont_write_bytecode
+
+ If this is true, Python won't try to write ``.pyc`` or ``.pyo`` files on the
+ import of source modules. This value is initially set to ``True`` or ``False``
+ depending on the ``-B`` command line option and the ``PYTHONDONTWRITEBYTECODE``
+ environment variable, but you can set it yourself to control bytecode file
+ generation.
+
+ .. versionadded:: 2.6
+
+
.. function:: setcheckinterval(interval)
Set the interpreter's "check interval". This integer value determines how often
diff --git a/Doc/using/cmdline.rst b/Doc/using/cmdline.rst
index 5f6bda5..b113c8f 100644
--- a/Doc/using/cmdline.rst
+++ b/Doc/using/cmdline.rst
@@ -145,6 +145,14 @@
Miscellaneous options
~~~~~~~~~~~~~~~~~~~~~
+.. cmdoption:: -B
+
+ If given, Python won't try to write ``.pyc`` or ``.pyo`` files on the
+ import of source modules. See also :envvar:`PYTHONDONTWRITEBYTECODE`.
+
+ .. versionadded:: 2.6
+
+
.. cmdoption:: -d
Turn on parser debugging output (for wizards only, depending on compilation
@@ -411,3 +419,10 @@
If this is set, Python ignores case in :keyword:`import` statements. This
only works on Windows.
+
+.. envvar:: PYTHONDONTWRITEBYTECODE
+
+ If given, Python won't try to write ``.pyc`` or ``.pyo`` files on the
+ import of source modules.
+
+ .. versionadded:: 2.6