FAQ | This is a LIVE service | Changelog

Skip to content
Snippets Groups Projects
Commit 163b4e0d authored by Silas S. Brown's avatar Silas S. Brown
Browse files

Gradint update

git-svn-id: http://svn.code.sf.net/p/e-guidedog/code/ssb22/gradint@1792 29193198-4895-4776-b068-10539e920549
parent f0a77a19
No related branches found
No related tags found
No related merge requests found
......@@ -490,15 +490,12 @@ elif macsound:
elif fileExists_stat("../Gradint 2.app/deleteme"):
import thread ; thread.start_new_thread(lambda *x:(time.sleep(2),os.system('rm -rf "../Gradint 2.app"')),())
try:
import distutils
import distutils.spawn as DUtil
except: DUtil = None
def got_program(prog):
if winsound:
return fileExists(prog+".exe")
elif unix:
if DUtil:
try:
import distutils.spawn
if ":." in ":"+os.environ.get("PATH",""):
prog = distutils.spawn.find_executable(prog)
else: # at least some distutils assume that . is in the PATH even when it isn't, so
......@@ -513,7 +510,8 @@ def got_program(prog):
if done:
prog = distutils.spawn.find_executable(prog)
os.chdir(oldCwd)
else: # not DUtil
except ImportError:
# fall back to running 'which' in a shell (probably slower if got_program is called repeatedly)
prog = os.popen("which "+prog+" 2>/dev/null").read().strip(wsp)
if not fileExists_stat(prog): prog=None # some Unix 'which' output an error to stdout instead of stderr, so check the result exists
return prog
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment