Index: build/android/gyp/util/build_utils.py |
diff --git a/build/android/gyp/util/build_utils.py b/build/android/gyp/util/build_utils.py |
index 65bd07b351ca6aaaf65b5f4a8aa050145d99d8f9..53e51ba0c81700ad66008bb7da448a82ac0f8b8e 100644 |
--- a/build/android/gyp/util/build_utils.py |
+++ b/build/android/gyp/util/build_utils.py |
@@ -406,7 +406,10 @@ def GetPythonDependencies(): |
A path is assumed to be a "system" import if it is outside of chromium's |
src/. The paths will be relative to the current directory. |
""" |
- module_paths = (m.__file__ for m in sys.modules.itervalues() |
+ # Don't use sys.modules.itervalues() here. Inspecting the modules causes |
+ # lazily imported modules (e.g. from email) to get fully imported and update |
+ # sys.modules. This causes a runtime error when iterating with itervalues(). |
+ module_paths = (m.__file__ for m in sys.modules.values() |
agrieve
2016/12/14 15:35:28
If it's being updated during iteration, then we're
|
if m is not None and hasattr(m, '__file__')) |
abs_module_paths = map(os.path.abspath, module_paths) |