2001-10-19 02:49:37 +08:00
|
|
|
# Test the frozen module defined in frozen.c.
|
|
|
|
|
2002-07-31 07:27:12 +08:00
|
|
|
from test.test_support import TestFailed
|
2001-10-19 02:49:37 +08:00
|
|
|
import sys, os
|
|
|
|
|
|
|
|
try:
|
|
|
|
import __hello__
|
|
|
|
except ImportError, x:
|
2002-11-01 19:33:00 +08:00
|
|
|
raise TestFailed, "import __hello__ failed:" + str(x)
|
2001-10-19 02:49:37 +08:00
|
|
|
|
|
|
|
try:
|
|
|
|
import __phello__
|
|
|
|
except ImportError, x:
|
2002-11-01 19:33:00 +08:00
|
|
|
raise TestFailed, "import __phello__ failed:" + str(x)
|
2001-10-19 02:49:37 +08:00
|
|
|
|
|
|
|
try:
|
|
|
|
import __phello__.spam
|
|
|
|
except ImportError, x:
|
2002-11-01 19:33:00 +08:00
|
|
|
raise TestFailed, "import __phello__.spam failed:" + str(x)
|
2001-10-19 02:49:37 +08:00
|
|
|
|
2003-01-09 00:30:54 +08:00
|
|
|
if sys.platform != "mac": # On the Mac this import does succeed.
|
|
|
|
try:
|
|
|
|
import __phello__.foo
|
|
|
|
except ImportError:
|
|
|
|
pass
|
|
|
|
else:
|
|
|
|
raise TestFailed, "import __phello__.foo should have failed"
|