Restore compatibility with Python 2.3

git-svn-id: http://svn.pyinstaller.org/trunk@826 8dd32b29-ccff-0310-8a9a-9233e24343b1
This commit is contained in:
giovannibajo
2010-04-28 09:36:05 +00:00
parent 75f0c3def3
commit b5ee2df91f
+10 -4
View File
@@ -98,10 +98,12 @@ def runtests(alltests, filters=None, configfile=None, run_executable=1):
tests = []
for part in filters:
tests += [t for t in alltests if part in t and t not in tests]
tests.sort(key=lambda x: (len(x), x)) # test1 < test10
tests = [(len(x), x) for x in tests]
tests.sort()
path = os.environ["PATH"]
counter = dict(passed=[],failed=[])
for test in tests:
for _,test in tests:
test = os.path.splitext(os.path.basename(test))[0]
_msg("BUILDING TEST", test)
prog = string.join([PYTHON, PYOPTS, os.path.join(HOME, 'Build.py'),
@@ -144,8 +146,12 @@ if __name__ == '__main__':
interactive_tests = glob.glob('test*i.spec')
from optparse import OptionParser
parser = OptionParser(usage="%prog [options] [TEST-NAME ...]",
epilog="TEST-NAME can be the name of the .py-file, the .spec-file or only the basename.")
if sys.version_info < (2,4):
parser = OptionParser(usage="%prog [options] [TEST-NAME ...]")
else:
parser = OptionParser(usage="%prog [options] [TEST-NAME ...]",
epilog="TEST-NAME can be the name of the .py-file, the .spec-file or only the basename.")
parser.add_option('-c', '--clean', action='store_true',
help='Clean up generated files')
parser.add_option('-i', '--interactive-tests', action='store_true',