Fixed bug with using pypy
This commit is contained in:
parent
5af72b4f99
commit
b9d2589f8b
9
ucompile
9
ucompile
@ -13,7 +13,7 @@ def check_dependencies() -> None:
|
|||||||
|
|
||||||
for command in commands:
|
for command in commands:
|
||||||
if os.system(f"which {command} > /dev/null") != 0:
|
if os.system(f"which {command} > /dev/null") != 0:
|
||||||
print(f"{Fore.RED}Error: {command} not found{Style.RESET_ALL}")
|
print(f"{Fore.ORANGE}WARNING: {command} not found{Style.RESET_ALL}")
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
||||||
@ -123,13 +123,14 @@ def run_input_cases(program, args):
|
|||||||
|
|
||||||
def python_compile(file_name, args):
|
def python_compile(file_name, args):
|
||||||
try:
|
try:
|
||||||
if subprocess.run(["which", "pypy3"]).returncode == 0:
|
if os.system("which pypy3 > /dev/null") == 0:
|
||||||
|
print(f"{Fore.LIGHTMAGENTA_EX}Using pypy3{Style.RESET_ALL}")
|
||||||
run_input_cases("pypy3 " + file_name, args)
|
run_input_cases("pypy3 " + file_name, args)
|
||||||
return
|
return
|
||||||
except Exception:
|
except Exception:
|
||||||
pass
|
pass
|
||||||
finally:
|
print(f"{Fore.MAGENTA}WARNING: pypy3 not found, using python3 instead{Style.RESET_ALL}")
|
||||||
run_input_cases("python3 " + file_name, args)
|
run_input_cases("python3 " + file_name, args)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user