Tim Peters | fe8a566 | 2006-03-01 06:28:58 +0000 | [diff] [blame] | 1 | import sys |
| 2 | |
| 3 | # This is a test module for Python. It looks in the standard |
| 4 | # places for various *.py files. If these are moved, you must |
| 5 | # change this module too. |
| 6 | |
| 7 | try: |
Thomas Wouters | 49fd7fa | 2006-04-21 10:40:58 +0000 | [diff] [blame] | 8 | import os |
Tim Peters | fe8a566 | 2006-03-01 06:28:58 +0000 | [diff] [blame] | 9 | except: |
Collin Winter | b13c493 | 2007-08-30 18:50:25 +0000 | [diff] [blame] | 10 | print("""Could not import the standard "os" module. |
| 11 | Please check your PYTHONPATH environment variable.""") |
Tim Peters | fe8a566 | 2006-03-01 06:28:58 +0000 | [diff] [blame] | 12 | sys.exit(1) |
| 13 | |
| 14 | try: |
Thomas Wouters | 49fd7fa | 2006-04-21 10:40:58 +0000 | [diff] [blame] | 15 | import symbol |
Tim Peters | fe8a566 | 2006-03-01 06:28:58 +0000 | [diff] [blame] | 16 | except: |
Collin Winter | b13c493 | 2007-08-30 18:50:25 +0000 | [diff] [blame] | 17 | print("""Could not import the standard "symbol" module. If this is |
| 18 | a PC, you should add the dos_8x3 directory to your PYTHONPATH.""") |
Tim Peters | fe8a566 | 2006-03-01 06:28:58 +0000 | [diff] [blame] | 19 | sys.exit(1) |
| 20 | |
Tim Peters | fe8a566 | 2006-03-01 06:28:58 +0000 | [diff] [blame] | 21 | for dir in sys.path: |
Thomas Wouters | 49fd7fa | 2006-04-21 10:40:58 +0000 | [diff] [blame] | 22 | file = os.path.join(dir, "os.py") |
Tim Peters | fe8a566 | 2006-03-01 06:28:58 +0000 | [diff] [blame] | 23 | if os.path.isfile(file): |
| 24 | test = os.path.join(dir, "test") |
| 25 | if os.path.isdir(test): |
| 26 | # Add the "test" directory to PYTHONPATH. |
| 27 | sys.path = sys.path + [test] |
| 28 | |
Victor Stinner | 3aac0ad | 2016-03-24 17:53:20 +0100 | [diff] [blame] | 29 | import libregrtest # Standard Python tester. |
| 30 | libregrtest.main() |