diff options
author | Joannah Nanjekye <33177550+nanjekyejoannah@users.noreply.github.com> | 2019-05-28 16:29:04 (GMT) |
---|---|---|
committer | Berker Peksag <berker.peksag@gmail.com> | 2019-05-28 16:29:04 (GMT) |
commit | 2e33ecd7c9b0cac3efc6fcbdd4547fd086b4e2d1 (patch) | |
tree | b87106cad890030018bdefd2ca42092b58ed1330 /Doc/library/py_compile.rst | |
parent | 3c8724fc60163f4f3c3b0d531c84cc7b36783f82 (diff) | |
download | cpython-2e33ecd7c9b0cac3efc6fcbdd4547fd086b4e2d1.zip cpython-2e33ecd7c9b0cac3efc6fcbdd4547fd086b4e2d1.tar.gz cpython-2e33ecd7c9b0cac3efc6fcbdd4547fd086b4e2d1.tar.bz2 |
bpo-22640: Add silent mode to py_compile.compile() (GH-12976)
Diffstat (limited to 'Doc/library/py_compile.rst')
-rw-r--r-- | Doc/library/py_compile.rst | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/Doc/library/py_compile.rst b/Doc/library/py_compile.rst index 8cb5a4d..3824353 100644 --- a/Doc/library/py_compile.rst +++ b/Doc/library/py_compile.rst @@ -42,6 +42,13 @@ byte-code cache files in the directory containing the source code. is raised. This function returns the path to byte-compiled file, i.e. whatever *cfile* value was used. + The *doraise* and *quiet* arguments determine how errors are handled while + compiling file. If *quiet* is 0 or 1, and *doraise* is false, the default + behaviour is enabled: an error string is written to ``sys.stderr``, and the + function returns ``None`` instead of a path. If *doraise* is true, + a :exc:`PyCompileError` is raised instead. However if *quiet* is 2, + no message is written, and *doraise* has no effect. + If the path that *cfile* becomes (either explicitly specified or computed) is a symlink or non-regular file, :exc:`FileExistsError` will be raised. This is to act as a warning that import will turn those paths into regular @@ -82,6 +89,9 @@ byte-code cache files in the directory containing the source code. overrides the value of the *invalidation_mode* argument, and determines its default value instead. + .. versionchanged:: 3.8 + The *quiet* parameter was added. + .. class:: PycInvalidationMode |