allow py27 on windows
This commit is contained in:
parent
69dba72040
commit
4aba116b9a
|
@ -26,13 +26,13 @@ trans.install()
|
|||
|
||||
# if path is set to use an old version of python look for a new one:
|
||||
# (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']
|
||||
dirs = re.split(os.pathsep, os.environ['PATH'])
|
||||
# remove any trailing / or \ chars from dirs:
|
||||
dirs = [re.sub('[\\/]$','',p) for p in dirs]
|
||||
# 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)
|
||||
#print "new path =", tmppath
|
||||
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:
|
||||
os.execvpe('python', ('python', 'fpdb.pyw', '-r'), os.environ) # first arg is ignored (name of program being run)
|
||||
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."))
|
||||
exit()
|
||||
else:
|
||||
|
|
Loading…
Reference in New Issue
Block a user