summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorÉric Araujo <merwok@netwok.org>2011-10-08 02:09:15 (GMT)
committerÉric Araujo <merwok@netwok.org>2011-10-08 02:09:15 (GMT)
commita29e4f64c1dfeb4ca1cf9f4c9636cb4528b2fd8c (patch)
treef162133d4375ac1c80313861d6e409c186a849ee /Doc
parent73b1e7dd2098279910e89454d5ba92d5b46370da (diff)
downloadcpython-a29e4f64c1dfeb4ca1cf9f4c9636cb4528b2fd8c.zip
cpython-a29e4f64c1dfeb4ca1cf9f4c9636cb4528b2fd8c.tar.gz
cpython-a29e4f64c1dfeb4ca1cf9f4c9636cb4528b2fd8c.tar.bz2
Fix packaging byte-compilation to comply with PEP 3147 (#11254).
I want to replace custom byte-compiling function with calls to compileall before 3.3b1, but in the short term it’s good to have this fixed. Adapted from the distutils patch by Jeff Ramnani. I tested with -B, -O and -OO; test_util and test_mixin2to3 fail in -O mode because lib2to3 doesn’t support it.
Diffstat (limited to 'Doc')
-rw-r--r--Doc/library/packaging.util.rst9
1 files changed, 6 insertions, 3 deletions
diff --git a/Doc/library/packaging.util.rst b/Doc/library/packaging.util.rst
index 019f3e9..ae96d87 100644
--- a/Doc/library/packaging.util.rst
+++ b/Doc/library/packaging.util.rst
@@ -121,9 +121,12 @@ This module contains various helpers for the other modules.
.. function:: byte_compile(py_files[, optimize=0, force=0, prefix=None, base_dir=None, verbose=1, dry_run=0, direct=None])
Byte-compile a collection of Python source files to either :file:`.pyc` or
- :file:`.pyo` files in the same directory. *py_files* is a list of files to
- compile; any files that don't end in :file:`.py` are silently skipped.
- *optimize* must be one of the following:
+ :file:`.pyo` files in a :file:`__pycache__` subdirectory (see :pep:`3147`),
+ or to the same directory when using the distutils2 backport on Python
+ versions older than 3.2.
+
+ *py_files* is a list of files to compile; any files that don't end in
+ :file:`.py` are silently skipped. *optimize* must be one of the following:
* ``0`` - don't optimize (generate :file:`.pyc`)
* ``1`` - normal optimization (like ``python -O``)