From 5215646c8a2a23a2ce77e062bcbe18cedd561224 Mon Sep 17 00:00:00 2001 From: Steven Robertson Date: Tue, 25 Aug 2020 23:28:21 -0700 Subject: [PATCH] code cleanup --- ansible_mitogen/strategy.py | 1 - mitogen/core.py | 1 - mitogen/master.py | 9 ++------- mitogen/service.py | 2 +- 4 files changed, 3 insertions(+), 10 deletions(-) diff --git a/ansible_mitogen/strategy.py b/ansible_mitogen/strategy.py index 7b74e641..3ac15017 100644 --- a/ansible_mitogen/strategy.py +++ b/ansible_mitogen/strategy.py @@ -40,7 +40,6 @@ except ImportError: import mitogen.core import ansible_mitogen.affinity import ansible_mitogen.loaders -# import epdb; epdb.set_trace() import ansible_mitogen.mixins import ansible_mitogen.process diff --git a/mitogen/core.py b/mitogen/core.py index 762f263e..4dd44925 100644 --- a/mitogen/core.py +++ b/mitogen/core.py @@ -1471,7 +1471,6 @@ class Importer(object): def load_module(self, fullname): fullname = to_text(fullname) - # jjj _v and self._log.debug('requesting %s', fullname) self._refuse_imports(fullname) diff --git a/mitogen/master.py b/mitogen/master.py index e1a352e2..89df5e4f 100644 --- a/mitogen/master.py +++ b/mitogen/master.py @@ -146,7 +146,7 @@ def is_stdlib_path(path): ) -def get_child_modules(path, fullname): +def get_child_modules(path): """ Return the suffixes of submodules directly neated beneath of the package directory at `path`. @@ -156,10 +156,6 @@ def get_child_modules(path, fullname): equivalent. Usually this is the module's ``__file__`` attribute, but is specified explicitly to avoid loading the module. - :param str fullname: - Full name of a module path. Only used with collections because - its modules can't be loaded with iter_modules() - :return: List of submodule name suffixes. """ @@ -552,7 +548,6 @@ class SysModulesMethod(FinderMethod): Find `fullname` using its :data:`__file__` attribute. """ module = sys.modules.get(fullname) - if not isinstance(module, types.ModuleType): LOG.debug('%r: sys.modules[%r] absent or not a regular module', self, fullname) @@ -989,7 +984,7 @@ class ModuleResponder(object): self.minify_secs += mitogen.core.now() - t0 if is_pkg: - pkg_present = get_child_modules(path, fullname) + pkg_present = get_child_modules(path) self._log.debug('%s is a package at %s with submodules %r', fullname, path, pkg_present) else: diff --git a/mitogen/service.py b/mitogen/service.py index 0b27b3d6..249a8781 100644 --- a/mitogen/service.py +++ b/mitogen/service.py @@ -763,10 +763,10 @@ class PushFileService(Service): overridden_source = overridden_sources[path] self.propagate_to(context, mitogen.core.to_text(path), overridden_source) # self.router.responder.forward_modules(context, modules) TODO + # NOTE: could possibly be handled by the above TODO, but not sure how forward_modules works enough # to know for sure, so for now going to pass the sys paths themselves and have `propagate_to` # load them up in sys.path for later import - # jjjj # ensure we don't add to sys.path the same path we've already seen for extra_path in extra_sys_paths: # store extra paths in cached set for O(1) lookup