Utilities/__init__.py

changeset 1329
ac21bb9cf8b9
parent 1316
0bb67aced672
child 1348
38d4a35aa308
equal deleted inserted replaced
1327:8da240d10f91 1329:ac21bb9cf8b9
671 via the searchpath defined by the PATH environment variable. 671 via the searchpath defined by the PATH environment variable.
672 """ 672 """
673 if os.path.isabs(file): 673 if os.path.isabs(file):
674 return os.access(file, os.X_OK) 674 return os.access(file, os.X_OK)
675 675
676 if os.path.exists(os.path.join(os.curdir, file)):
677 return os.access(os.path.join(os.curdir, file), os.X_OK)
678
676 path = getEnvironmentEntry('PATH') 679 path = getEnvironmentEntry('PATH')
677 680
678 # environment variable not defined 681 # environment variable not defined
679 if path is None: 682 if path is None:
680 return False 683 return False
700 if os.access(file, os.X_OK): 703 if os.access(file, os.X_OK):
701 return file 704 return file
702 else: 705 else:
703 return "" 706 return ""
704 707
708 cur_path = os.path.join(os.curdir, file)
709 if os.path.exists(cur_path):
710 if os.access(cur_path, os.X_OK):
711 return cur_path
712
705 path = os.getenv('PATH') 713 path = os.getenv('PATH')
706 714
707 # environment variable not defined 715 # environment variable not defined
708 if path is None: 716 if path is None:
709 return "" 717 return ""

eric ide

mercurial