mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
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:
parent
9ae09947f4
commit
4114a4afec
4 changed files with 43 additions and 5 deletions
26
Lib/test/test_frozen.py
Normal file
26
Lib/test/test_frozen.py
Normal 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"
|
Loading…
Add table
Add a link
Reference in a new issue