Fixed pypy bug
parent
4f8788bdee
commit
1647025aa4
13
main.py
13
main.py
|
@ -65,14 +65,15 @@ def get_cmd(fn):
|
|||
ext = fn.split('.')[-1]
|
||||
if ext == 'py':
|
||||
with open(fn) as f:
|
||||
shebang = f.read().lstrip().split('\n')[0]
|
||||
if shebang[:2] != '#!':
|
||||
cmd = 'python '
|
||||
|
||||
fst_line = f.read().lstrip().split('\n')[0]
|
||||
if fst_line[:2] != '#!':
|
||||
return 'python '
|
||||
shebang = fst_line[2:]
|
||||
if pypy_installed:
|
||||
return shebang[2:].replace('python', 'pypy') + ' '
|
||||
return shebang.replace('python', 'pypy') + ' '
|
||||
if pypy3_installed:
|
||||
return shebang[2:].replace('python3', 'pypy3') + ' '
|
||||
return shebang.replace('python3', 'pypy3') + ' '
|
||||
return shebang
|
||||
return './'
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue