[Python-checkins] cpython (3.3): Fix a test to not use an assertion for something that could be

brett.cannon python-checkins at python.org
Sun May 5 00:11:39 CEST 2013


http://hg.python.org/cpython/rev/996a937cdf81
changeset:   83621:996a937cdf81
branch:      3.3
parent:      83615:0dfd5c7d953d
user:        Brett Cannon <brett at python.org>
date:        Sat May 04 18:11:12 2013 -0400
summary:
  Fix a test to not use an assertion for something that could be
legitimately false.

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


diff --git a/Lib/test/test_imp.py b/Lib/test/test_imp.py
--- a/Lib/test/test_imp.py
+++ b/Lib/test/test_imp.py
@@ -241,8 +241,9 @@
         # Issue #15902
         name = '_heapq'
         found = imp.find_module(name)
-        assert found[2][2] == imp.C_EXTENSION
         found[0].close()
+        if found[2][2] != imp.C_EXTENSION:
+            return
         imp.load_module(name, None, *found[1:])
 
 

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


More information about the Python-checkins mailing list