[Python-checkins] bpo-42403: Fix pyflakes warnings in importlib (GH-23396)
vstinner
webhook-mailer at python.org
Thu Nov 19 05:21:03 EST 2020
https://github.com/python/cpython/commit/7d9d25dbedfffce61fc76bc7ccbfa9ae901bf56f
commit: 7d9d25dbedfffce61fc76bc7ccbfa9ae901bf56f
branch: master
author: Victor Stinner <vstinner at python.org>
committer: vstinner <vstinner at python.org>
date: 2020年11月19日T11:20:57+01:00
summary:
bpo-42403: Fix pyflakes warnings in importlib (GH-23396)
Remove unused imports and unused local variables.
files:
M Lib/importlib/abc.py
M Lib/importlib/machinery.py
M Lib/importlib/util.py
diff --git a/Lib/importlib/abc.py b/Lib/importlib/abc.py
index 97d5afa300193..55e70889f22f7 100644
--- a/Lib/importlib/abc.py
+++ b/Lib/importlib/abc.py
@@ -1,5 +1,4 @@
"""Abstract base classes related to import."""
-from . import _bootstrap
from . import _bootstrap_external
from . import machinery
try:
diff --git a/Lib/importlib/machinery.py b/Lib/importlib/machinery.py
index 1b2b5c9b4f340..9a7757fb6e449 100644
--- a/Lib/importlib/machinery.py
+++ b/Lib/importlib/machinery.py
@@ -1,7 +1,5 @@
"""The machinery of importlib: finders, loaders, hooks, etc."""
-import _imp
-
from ._bootstrap import ModuleSpec
from ._bootstrap import BuiltinImporter
from ._bootstrap import FrozenImporter
diff --git a/Lib/importlib/util.py b/Lib/importlib/util.py
index 1e44843a687f2..98a0fa54dfd87 100644
--- a/Lib/importlib/util.py
+++ b/Lib/importlib/util.py
@@ -232,7 +232,6 @@ def __getattribute__(self, attr):
# Figure out exactly what attributes were mutated between the creation
# of the module and now.
attrs_then = self.__spec__.loader_state['__dict__']
- original_type = self.__spec__.loader_state['__class__']
attrs_now = self.__dict__
attrs_updated = {}
for key, value in attrs_now.items():
More information about the Python-checkins
mailing list