198 if os.path.exists(program): |
198 if os.path.exists(program): |
199 with open(program) as f: |
199 with open(program) as f: |
200 for line in f: |
200 for line in f: |
201 line = line.strip() |
201 line = line.strip() |
202 if line: |
202 if line: |
203 for name in PYTHON_NAMES: # __IGNORE_WARNING_Y110__ |
203 return any( |
204 if line.startswith("#!/usr/bin/env {0}".format(name)) or ( |
204 line.startswith("#!/usr/bin/env {0}".format(name)) |
205 line.startswith("#!") and name in line |
205 or (line.startswith("#!") and name in line) |
206 ): |
206 for name in PYTHON_NAMES |
207 return True |
207 ) |
208 return False |
|
209 else: |
208 else: |
210 return False |
209 return False |
211 except UnicodeDecodeError: |
210 except UnicodeDecodeError: |
212 return False |
211 return False |
213 except Exception: |
212 except Exception: |