summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorBerker Peksag <berker.peksag@gmail.com>2016-09-30 21:54:18 (GMT)
committerBerker Peksag <berker.peksag@gmail.com>2016-09-30 21:54:18 (GMT)
commit812a2b65af1897aa9694ff65fc62516a4e10269c (patch)
tree5cb56a40cbef3dda1cc42953d8fae00ae7562df6 /Doc
parentb4b55eb582e5a7c71bac90030ab3c46b5cd6d429 (diff)
downloadcpython-812a2b65af1897aa9694ff65fc62516a4e10269c.zip
cpython-812a2b65af1897aa9694ff65fc62516a4e10269c.tar.gz
cpython-812a2b65af1897aa9694ff65fc62516a4e10269c.tar.bz2
Issue #28226: compileall now supports pathlib
Diffstat (limited to 'Doc')
-rw-r--r--Doc/library/compileall.rst6
1 files changed, 6 insertions, 0 deletions
diff --git a/Doc/library/compileall.rst b/Doc/library/compileall.rst
index 91bdd18..c1af02b 100644
--- a/Doc/library/compileall.rst
+++ b/Doc/library/compileall.rst
@@ -153,6 +153,9 @@ Public functions
The *legacy* parameter only writes out ``.pyc`` files, not ``.pyo`` files
no matter what the value of *optimize* is.
+ .. versionchanged:: 3.6
+ Accepts a :term:`path-like object`.
+
.. function:: compile_file(fullname, ddir=None, force=False, rx=None, quiet=0, legacy=False, optimize=-1)
Compile the file with path *fullname*. Return a true value if the file
@@ -221,6 +224,9 @@ subdirectory and all its subdirectories::
import re
compileall.compile_dir('Lib/', rx=re.compile(r'[/\\][.]svn'), force=True)
+ # pathlib.Path objects can also be used.
+ import pathlib
+ compileall.compile_dir(pathlib.Path('Lib/'), force=True)
.. seealso::