mirror of
https://github.com/python/cpython.git
synced 2025-07-23 19:25:40 +00:00

:-). Add a test that prevents the __hello__ bytecode from going stale unnoticed again. The test also tests the loophole noted in SF bug #404545. This test will fail right now; I'll check in the fix in a minute.
26 lines
550 B
Python
26 lines
550 B
Python
# Test the frozen module defined in frozen.c.
|
|
|
|
from test_support import TestFailed
|
|
import sys, os
|
|
|
|
try:
|
|
import __hello__
|
|
except ImportError, x:
|
|
raise TestFailed, "import __hello__ failed:", x
|
|
|
|
try:
|
|
import __phello__
|
|
except ImportError, x:
|
|
raise TestFailed, "import __phello__ failed:", x
|
|
|
|
try:
|
|
import __phello__.spam
|
|
except ImportError, x:
|
|
raise TestFailed, "import __phello__.spam failed:", x
|
|
|
|
try:
|
|
import __phello__.foo
|
|
except ImportError:
|
|
pass
|
|
else:
|
|
raise TestFailed, "import __phello__.foo should have failed"
|