diff options
author | shadchin <[email protected]> | 2022-02-10 16:44:39 +0300 |
---|---|---|
committer | Daniil Cherednik <[email protected]> | 2022-02-10 16:44:39 +0300 |
commit | e9656aae26e0358d5378e5b63dcac5c8dbe0e4d0 (patch) | |
tree | 64175d5cadab313b3e7039ebaa06c5bc3295e274 /contrib/tools/python3/src/Lib/runpy.py | |
parent | 2598ef1d0aee359b4b6d5fdd1758916d5907d04f (diff) |
Restoring authorship annotation for <[email protected]>. Commit 2 of 2.
Diffstat (limited to 'contrib/tools/python3/src/Lib/runpy.py')
-rw-r--r-- | contrib/tools/python3/src/Lib/runpy.py | 16 |
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 fb8b463c5d3..7e1e1ac5dde 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 |