Guido van Rossum | 4114a4a | 2001-10-18 18:49:37 +0000 | [diff] [blame] | 1 | # Test the frozen module defined in frozen.c. |
Guido van Rossum | 4f72a78 | 2006-10-27 23:31:49 +0000 | [diff] [blame] | 2 | # Currently test_frozen fails: |
| 3 | # Implementing pep3102(keyword only argument) needs changes in |
| 4 | # code object, which needs modification to marshal. |
| 5 | # However, to regenerate hard-coded marshal data in frozen.c, |
| 6 | # we need to run Tools/freeze/freeze.py, which currently doesn't work |
| 7 | # because Lib/modulefinder.py cannot handle relative module import |
| 8 | # This test will keep failing until Lib/modulefinder.py is fixed |
Guido van Rossum | 4114a4a | 2001-10-18 18:49:37 +0000 | [diff] [blame] | 9 | |
Barry Warsaw | 408b6d3 | 2002-07-30 23:27:12 +0000 | [diff] [blame] | 10 | from test.test_support import TestFailed |
Guido van Rossum | 4114a4a | 2001-10-18 18:49:37 +0000 | [diff] [blame] | 11 | import sys, os |
| 12 | |
| 13 | try: |
| 14 | import __hello__ |
Guido van Rossum | b940e11 | 2007-01-10 16:19:56 +0000 | [diff] [blame] | 15 | except ImportError as x: |
Finn Bock | 218c5f9 | 2002-11-01 11:33:00 +0000 | [diff] [blame] | 16 | raise TestFailed, "import __hello__ failed:" + str(x) |
Guido van Rossum | 4114a4a | 2001-10-18 18:49:37 +0000 | [diff] [blame] | 17 | |
| 18 | try: |
| 19 | import __phello__ |
Guido van Rossum | b940e11 | 2007-01-10 16:19:56 +0000 | [diff] [blame] | 20 | except ImportError as x: |
Finn Bock | 218c5f9 | 2002-11-01 11:33:00 +0000 | [diff] [blame] | 21 | raise TestFailed, "import __phello__ failed:" + str(x) |
Guido van Rossum | 4114a4a | 2001-10-18 18:49:37 +0000 | [diff] [blame] | 22 | |
| 23 | try: |
| 24 | import __phello__.spam |
Guido van Rossum | b940e11 | 2007-01-10 16:19:56 +0000 | [diff] [blame] | 25 | except ImportError as x: |
Finn Bock | 218c5f9 | 2002-11-01 11:33:00 +0000 | [diff] [blame] | 26 | raise TestFailed, "import __phello__.spam failed:" + str(x) |
Guido van Rossum | 4114a4a | 2001-10-18 18:49:37 +0000 | [diff] [blame] | 27 | |
Jack Jansen | 2918ae8 | 2003-01-08 16:30:54 +0000 | [diff] [blame] | 28 | if sys.platform != "mac": # On the Mac this import does succeed. |
| 29 | try: |
| 30 | import __phello__.foo |
| 31 | except ImportError: |
| 32 | pass |
| 33 | else: |
| 34 | raise TestFailed, "import __phello__.foo should have failed" |