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]
|
ext = fn.split('.')[-1]
|
||||||
if ext == 'py':
|
if ext == 'py':
|
||||||
with open(fn) as f:
|
with open(fn) as f:
|
||||||
shebang = f.read().lstrip().split('\n')[0]
|
fst_line = f.read().lstrip().split('\n')[0]
|
||||||
if shebang[:2] != '#!':
|
if fst_line[:2] != '#!':
|
||||||
cmd = 'python '
|
return 'python '
|
||||||
|
shebang = fst_line[2:]
|
||||||
if pypy_installed:
|
if pypy_installed:
|
||||||
return shebang[2:].replace('python', 'pypy') + ' '
|
return shebang.replace('python', 'pypy') + ' '
|
||||||
if pypy3_installed:
|
if pypy3_installed:
|
||||||
return shebang[2:].replace('python3', 'pypy3') + ' '
|
return shebang.replace('python3', 'pypy3') + ' '
|
||||||
|
return shebang
|
||||||
return './'
|
return './'
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue