From 69e82e96be3ab423d86aac9ea097f28521a356eb Mon Sep 17 00:00:00 2001 From: Mikhail Golubev Date: Tue, 28 May 2019 21:42:41 +0300 Subject: [PATCH] Simplify the condition for submodules GitOrigin-RevId: 70f11914a4dc2fcd734c035ee898fba0f2e16c56 --- python/helpers/generator3.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/python/helpers/generator3.py b/python/helpers/generator3.py index a6ccefe5e70b..c1926b532e5e 100644 --- a/python/helpers/generator3.py +++ b/python/helpers/generator3.py @@ -561,12 +561,10 @@ def process_one(name, mod_file_name, doing_builtins, sdk_skeletons_dir): for m in sys.modules.keys(): if m.startswith("pycharm_generator_utils"): continue action("looking at possible submodule %r", m) - # if module has __file__ defined, it has Python source code and doesn't need a skeleton - if (m not in old_modules and - m not in imported_module_names and - m != name and - not hasattr(sys.modules[m], '__file__') and - m not in sys.builtin_module_names): + if m == name or m in old_modules or m in sys.builtin_module_names: + continue + # Synthetic module, not explicitly imported + if m not in imported_module_names and not hasattr(sys.modules[m], '__file__'): if not quiet: say(m) sys.stdout.flush()