aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/tools/python3/src/Lib/py_compile.py
diff options
context:
space:
mode:
authorshadchin <shadchin@yandex-team.ru>2022-02-10 16:44:30 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:44:30 +0300
commit2598ef1d0aee359b4b6d5fdd1758916d5907d04f (patch)
tree012bb94d777798f1f56ac1cec429509766d05181 /contrib/tools/python3/src/Lib/py_compile.py
parent6751af0b0c1b952fede40b19b71da8025b5d8bcf (diff)
downloadydb-2598ef1d0aee359b4b6d5fdd1758916d5907d04f.tar.gz
Restoring authorship annotation for <shadchin@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'contrib/tools/python3/src/Lib/py_compile.py')
-rw-r--r--contrib/tools/python3/src/Lib/py_compile.py24
1 files changed, 12 insertions, 12 deletions
diff --git a/contrib/tools/python3/src/Lib/py_compile.py b/contrib/tools/python3/src/Lib/py_compile.py
index a81f493731..c5caa06f26 100644
--- a/contrib/tools/python3/src/Lib/py_compile.py
+++ b/contrib/tools/python3/src/Lib/py_compile.py
@@ -77,7 +77,7 @@ def _get_default_invalidation_mode():
def compile(file, cfile=None, dfile=None, doraise=False, optimize=-1,
- invalidation_mode=None, quiet=0):
+ invalidation_mode=None, quiet=0):
"""Byte-compile one Python source file to Python bytecode.
:param file: The source file name.
@@ -95,8 +95,8 @@ def compile(file, cfile=None, dfile=None, doraise=False, optimize=-1,
are -1, 0, 1 and 2. A value of -1 means to use the optimization
level of the current interpreter, as given by -O command line options.
:param invalidation_mode:
- :param quiet: Return full output with False or 0, errors only with 1,
- and no output with 2.
+ :param quiet: Return full output with False or 0, errors only with 1,
+ and no output with 2.
:return: Path to the resulting byte compiled file.
@@ -145,12 +145,12 @@ def compile(file, cfile=None, dfile=None, doraise=False, optimize=-1,
_optimize=optimize)
except Exception as err:
py_exc = PyCompileError(err.__class__, err, dfile or file)
- if quiet < 2:
- if doraise:
- raise py_exc
- else:
- sys.stderr.write(py_exc.msg + '\n')
- return
+ if quiet < 2:
+ if doraise:
+ raise py_exc
+ else:
+ sys.stderr.write(py_exc.msg + '\n')
+ return
try:
dirname = os.path.dirname(cfile)
if dirname:
@@ -197,10 +197,10 @@ def main(args=None):
compile(filename, doraise=True)
except PyCompileError as error:
rv = 1
- sys.stderr.write("%s\n" % error.msg)
+ sys.stderr.write("%s\n" % error.msg)
except OSError as error:
rv = 1
- sys.stderr.write("%s\n" % error)
+ sys.stderr.write("%s\n" % error)
else:
for filename in args:
try:
@@ -208,7 +208,7 @@ def main(args=None):
except PyCompileError as error:
# return value to indicate at least one failure
rv = 1
- sys.stderr.write("%s\n" % error.msg)
+ sys.stderr.write("%s\n" % error.msg)
return rv
if __name__ == "__main__":