aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/tools/python3/src/Lib/runpy.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/runpy.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/runpy.py')
-rw-r--r--contrib/tools/python3/src/Lib/runpy.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/contrib/tools/python3/src/Lib/runpy.py b/contrib/tools/python3/src/Lib/runpy.py
index 7e1e1ac5dd..fb8b463c5d 100644
--- a/contrib/tools/python3/src/Lib/runpy.py
+++ b/contrib/tools/python3/src/Lib/runpy.py
@@ -13,9 +13,9 @@ importers when locating support scripts as well as when importing modules.
import sys
import importlib.machinery # importlib first so we can test #15386 via -m
import importlib.util
-import io
+import io
import types
-import os
+import os
from pkgutil import read_code, get_importer
__all__ = [
@@ -133,9 +133,9 @@ def _get_module_details(mod_name, error=ImportError):
# importlib, where the latter raises other errors for cases where
# pkgutil previously raised ImportError
msg = "Error while finding module specification for {!r} ({}: {})"
- if mod_name.endswith(".py"):
- msg += (f". Try using '{mod_name[:-3]}' instead of "
- f"'{mod_name}' as the module name.")
+ if mod_name.endswith(".py"):
+ msg += (f". Try using '{mod_name[:-3]}' instead of "
+ f"'{mod_name}' as the module name.")
raise error(msg.format(mod_name, type(ex).__name__, ex)) from ex
if spec is None:
raise error("No module named %s" % mod_name)
@@ -233,12 +233,12 @@ def _get_main_module_details(error=ImportError):
def _get_code_from_file(run_name, fname):
# Check for a compiled file first
- decoded_path = os.path.abspath(os.fsdecode(fname))
- with io.open_code(decoded_path) as f:
+ decoded_path = os.path.abspath(os.fsdecode(fname))
+ with io.open_code(decoded_path) as f:
code = read_code(f)
if code is None:
# That didn't work, so try it as normal source code
- with io.open_code(decoded_path) as f:
+ with io.open_code(decoded_path) as f:
code = compile(f.read(), fname, 'exec')
return code, fname