code cleanup
This commit is contained in:
parent
0b421e0d3c
commit
5215646c8a
|
@ -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
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue