128 if os.access(exe, os.X_OK): |
128 if os.access(exe, os.X_OK): |
129 exes.append(exe) |
129 exes.append(exe) |
130 |
130 |
131 # step 2: determine the Python 3 variant |
131 # step 2: determine the Python 3 variant |
132 found = False |
132 found = False |
|
133 if Utilities.isMacPlatform(): |
|
134 checkStr = "Python.framework/Versions/3".lower() |
|
135 else: |
|
136 checkStr = "python3" |
133 for exe in exes: |
137 for exe in exes: |
134 try: |
138 try: |
135 f = open(exe, "r") |
139 f = open(exe, "r") |
136 line0 = f.readline() |
140 line0 = f.readline() |
137 if "python3" in line0.lower(): |
141 if checkStr in line0.lower(): |
138 found = True |
142 found = True |
139 finally: |
143 finally: |
140 f.close() |
144 f.close() |
141 if found: |
145 if found: |
142 return exe |
146 return exe |