Refactor to avord redefining argument

pull/15682/head
Mehrdad Afshari 7 years ago
parent c095c5c847
commit b6955d996f
  1. 10
      src/python/grpcio_tests/tests/_loader.py

@ -48,12 +48,12 @@ class Loader(object):
# measure unnecessarily suffers)
coverage_context = coverage.Coverage(data_suffix=True)
coverage_context.start()
modules = [importlib.import_module(name) for name in names]
for module in modules:
self.visit_module(module)
for module in modules:
imported_modules = tuple(importlib.import_module(name) for name in names)
for imported_module in imported_modules:
self.visit_module(imported_module)
for imported_module in imported_modules:
try:
package_paths = module.__path__
package_paths = imported_module.__path__
except AttributeError:
continue
self.walk_packages(package_paths)

Loading…
Cancel
Save