Commit 5f4fb913 authored by Guido van Rossum's avatar Guido van Rossum

Test that "import sys.imp" fails as it should.

parent 9c0afe5d
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
import sys, os, string, tempfile, traceback import sys, os, string, tempfile, traceback
from os import mkdir, rmdir # Can't test if these fail from os import mkdir, rmdir # Can't test if these fail
del mkdir, rmdir del mkdir, rmdir
from test_support import verbose from test_support import verbose, TestFailed
# Helpers to create and destroy hierarchies. # Helpers to create and destroy hierarchies.
...@@ -212,3 +212,14 @@ for name, hier, code in tests: ...@@ -212,3 +212,14 @@ for name, hier, code in tests:
continue continue
print "running test", name print "running test", name
runtest(hier, code) runtest(hier, code)
# Test
import sys
import imp
try:
import sys.imp
except ImportError:
# This is what we expect
pass
else:
raise TestFailed, "No ImportError exception on 'import sys.imp'"
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment