Updated for 2.1b2 distribution.
[python/dscho.git] / PC / testpy.py
blobef8ba7aef449a36f189dae9f0ba9977c1b5c8717
1 import sys
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.
7 try:
8 import string
9 except:
10 print """Could not import the standard "string" module.
11 Please check your PYTHONPATH environment variable."""
12 sys.exit(1)
14 try:
15 import regex_syntax
16 except:
17 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)
21 import os
23 for dir in sys.path:
24 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]
31 import regrtest # Standard Python tester.
32 regrtest.main()