blob: fd1b1e42f89b730a5918cc73e416e2cdd47efa2c [file] [log] [blame]
Guido van Rossum1aa7e3a1997-05-19 14:16:21 +00001import 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
7try:
Tim Peters3d7d3722004-07-18 06:25:50 +00008 import string
Guido van Rossum1aa7e3a1997-05-19 14:16:21 +00009except:
Tim Peters3d7d3722004-07-18 06:25:50 +000010 print """Could not import the standard "string" module.
11 Please check your PYTHONPATH environment variable."""
12 sys.exit(1)
Guido van Rossum1aa7e3a1997-05-19 14:16:21 +000013
14try:
Tim Peters3d7d3722004-07-18 06:25:50 +000015 import regex_syntax
Guido van Rossum1aa7e3a1997-05-19 14:16:21 +000016except:
Tim Peters3d7d3722004-07-18 06:25:50 +000017 print """Could not import the standard "regex_syntax" module. If this is
18 a PC, you should add the dos_8x3 directory to your PYTHONPATH."""
19 sys.exit(1)
Guido van Rossum1aa7e3a1997-05-19 14:16:21 +000020
21import os
22
23for dir in sys.path:
Tim Peters3d7d3722004-07-18 06:25:50 +000024 file = os.path.join(dir, "string.py")
25 if os.path.isfile(file):
26 test = os.path.join(dir, "test")
27 if os.path.isdir(test):
28 # Add the "test" directory to PYTHONPATH.
29 sys.path = sys.path + [test]
Guido van Rossum1aa7e3a1997-05-19 14:16:21 +000030
Tim Peters3d7d3722004-07-18 06:25:50 +000031import regrtest # Standard Python tester.
Guido van Rossum1aa7e3a1997-05-19 14:16:21 +000032regrtest.main()