Change: using 'run' method instead of the depricated 'call' method

This commit is contained in:
Abdalaziz Rashid 2020-07-15 13:35:23 +03:00
parent 95b8ccfad4
commit ea8a43c4eb

View file

@ -10,6 +10,9 @@ from subprocess import call
import sys import sys
import csv import csv
import sympy as sp import sympy as sp
from pathlib import Path
from sympy.parsing.sympy_parser import parse_expr from sympy.parsing.sympy_parser import parse_expr
# sep_type = 3 for add and 2 for mult and 1 for normal # sep_type = 3 for add and 2 for mult and 1 for normal
@ -22,10 +25,18 @@ def brute_force(pathdir,filename,BF_try_time,BF_ops_file_type,sep_type="*"):
except: except:
pass pass
if sep_type=="*": if sep_type=="*":
subprocess.call(["./brute_force_oneFile_v2.scr", file_type, "%s" %try_time, pathdir+filename]) # 'check=False' because it will return exit status 124 when it time out
subprocess.run([Path("./brute_force_oneFile_v2.scr").resolve(),
file_type, "%s" %try_time,
Path(pathdir+filename).resolve()],
shell=False, check=False)
#subprocess.call(["./brute_force_oneFile_mdl_v3.scr", file_type, "%s" %try_time, pathdir+filename, "10", "0"]) #subprocess.call(["./brute_force_oneFile_mdl_v3.scr", file_type, "%s" %try_time, pathdir+filename, "10", "0"])
if sep_type=="+": if sep_type=="+":
subprocess.call(["./brute_force_oneFile_v3.scr", file_type, "%s" %try_time, pathdir+filename]) # 'check=False' because it will return exit status 124 when it time out
subprocess.run([Path("./brute_force_oneFile_v3.scr").resolve(),
file_type, "%s" %try_time,
Path(pathdir+filename).resolve()],
shell=False, check=False)
#subprocess.call(["./brute_force_oneFile_mdl_v2.scr", file_type, "%s" %try_time, pathdir+filename, "10", "0"]) #subprocess.call(["./brute_force_oneFile_mdl_v2.scr", file_type, "%s" %try_time, pathdir+filename, "10", "0"])
return 1 return 1