From bd6c00aabe9a34715a5b2026eeccac4bc2a8d0de Mon Sep 17 00:00:00 2001 From: "A. Unique TensorFlower" Date: Wed, 2 May 2018 13:42:40 -0700 Subject: [PATCH] Fix a bug in create_python_api.py I got an error complaining about "RuntimeError: dictionary changed size during iteration", this change fixes it. PiperOrigin-RevId: 195144333 --- tensorflow/tools/api/generator/create_python_api.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tensorflow/tools/api/generator/create_python_api.py b/tensorflow/tools/api/generator/create_python_api.py index c06a39b..65baa6e 100644 --- a/tensorflow/tools/api/generator/create_python_api.py +++ b/tensorflow/tools/api/generator/create_python_api.py @@ -158,7 +158,7 @@ def get_api_init_text(): # Traverse over everything imported above. Specifically, # we want to traverse over TensorFlow Python modules. - for module in sys.modules.values(): + for module in list(sys.modules.values()): # Only look at tensorflow modules. if (not module or not hasattr(module, '__name__') or 'tensorflow.' not in module.__name__): -- 2.7.4