allow py27 on windows

This commit is contained in:
steffen123 2010-08-13 04:10:13 +02:00
parent 69dba72040
commit 4aba116b9a

View File

@ -26,13 +26,13 @@ trans.install()
# if path is set to use an old version of python look for a new one: # if path is set to use an old version of python look for a new one:
# (does this work in linux?) # (does this work in linux?)
if os.name == 'nt' and sys.version[0:3] not in ('2.5', '2.6') and '-r' not in sys.argv: if os.name == 'nt' and sys.version[0:3] not in ('2.5', '2.6', '2.7') and '-r' not in sys.argv:
#print "old path =", os.environ['PATH'] #print "old path =", os.environ['PATH']
dirs = re.split(os.pathsep, os.environ['PATH']) dirs = re.split(os.pathsep, os.environ['PATH'])
# remove any trailing / or \ chars from dirs: # remove any trailing / or \ chars from dirs:
dirs = [re.sub('[\\/]$','',p) for p in dirs] dirs = [re.sub('[\\/]$','',p) for p in dirs]
# remove any dirs containing 'python' apart from those ending in 'python25', 'python26' or 'python': # remove any dirs containing 'python' apart from those ending in 'python25', 'python26' or 'python':
dirs = [p for p in dirs if not re.search('python', p, re.I) or re.search('python25$', p, re.I) or re.search('python26$', p, re.I)] dirs = [p for p in dirs if not re.search('python', p, re.I) or re.search('python25$', p, re.I) or re.search('python26$', p, re.I) or re.search('python27$', p, re.I)]
tmppath = ";".join(dirs) tmppath = ";".join(dirs)
#print "new path =", tmppath #print "new path =", tmppath
if re.search('python', tmppath, re.I): if re.search('python', tmppath, re.I):
@ -44,7 +44,7 @@ if os.name == 'nt' and sys.version[0:3] not in ('2.5', '2.6') and '-r' not in sy
else: else:
os.execvpe('python', ('python', 'fpdb.pyw', '-r'), os.environ) # first arg is ignored (name of program being run) os.execvpe('python', ('python', 'fpdb.pyw', '-r'), os.environ) # first arg is ignored (name of program being run)
else: else:
print _("\npython 2.5 not found, please install python 2.5 or 2.6 for fpdb\n") print _("\npython 2.5 not found, please install python 2.5, 2.6 or 2.7 for fpdb\n")
raw_input(_("Press ENTER to continue.")) raw_input(_("Press ENTER to continue."))
exit() exit()
else: else: