[Python-checkins] cpython (2.7): make consulting save_modules O(1) rather than O(n)

benjamin.peterson python-checkins at python.org
Sat Dec 5 03:31:54 EST 2015


https://hg.python.org/cpython/rev/3192e2af7f52
changeset:   99460:3192e2af7f52
branch:      2.7
parent:      99450:a3aa22a55db3
user:        Benjamin Peterson <benjamin at python.org>
date:        Sat Dec 05 00:29:56 2015 -0800
summary:
  make consulting save_modules O(1) rather than O(n)

files:
  Lib/test/regrtest.py |  2 +-
  1 files changed, 1 insertions(+), 1 deletions(-)


diff --git a/Lib/test/regrtest.py b/Lib/test/regrtest.py
--- a/Lib/test/regrtest.py
+++ b/Lib/test/regrtest.py
@@ -462,7 +462,7 @@
 
     test_times = []
     test_support.use_resources = use_resources
-    save_modules = sys.modules.keys()
+    save_modules = set(sys.modules.keys())
 
     def accumulate_result(test, result):
         ok, test_time = result

-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list