Fix the frozen bytecode for __hello__ (betcha didn't know that existed

:-).

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.
This commit is contained in:
Guido van Rossum 2001-10-18 18:49:37 +00:00
parent 9ae09947f4
commit 4114a4afec
4 changed files with 43 additions and 5 deletions

26
Lib/test/test_frozen.py Normal file
View file

@ -0,0 +1,26 @@
# 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"