blob: 5387e5615774bc473534da5bfa12c7d7df78d089 [file] [log] [blame]
Guido van Rossum4114a4a2001-10-18 18:49:37 +00001# Test the frozen module defined in frozen.c.
2
Barry Warsaw408b6d32002-07-30 23:27:12 +00003from test.test_support import TestFailed
Guido van Rossum4114a4a2001-10-18 18:49:37 +00004import sys, os
5
6try:
7 import __hello__
Guido van Rossumb940e112007-01-10 16:19:56 +00008except ImportError as x:
Finn Bock218c5f92002-11-01 11:33:00 +00009 raise TestFailed, "import __hello__ failed:" + str(x)
Guido van Rossum4114a4a2001-10-18 18:49:37 +000010
11try:
12 import __phello__
Guido van Rossumb940e112007-01-10 16:19:56 +000013except ImportError as x:
Finn Bock218c5f92002-11-01 11:33:00 +000014 raise TestFailed, "import __phello__ failed:" + str(x)
Guido van Rossum4114a4a2001-10-18 18:49:37 +000015
16try:
17 import __phello__.spam
Guido van Rossumb940e112007-01-10 16:19:56 +000018except ImportError as x:
Finn Bock218c5f92002-11-01 11:33:00 +000019 raise TestFailed, "import __phello__.spam failed:" + str(x)
Guido van Rossum4114a4a2001-10-18 18:49:37 +000020
Jack Jansen2918ae82003-01-08 16:30:54 +000021if sys.platform != "mac": # On the Mac this import does succeed.
22 try:
23 import __phello__.foo
24 except ImportError:
25 pass
26 else:
27 raise TestFailed, "import __phello__.foo should have failed"