Skip to content

Commit ad69c27

Browse files
authored
Replace "python3" in command by sys.executable (#1105)
fix #1099
1 parent 749e28a commit ad69c27

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

dpgen/data/gen.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -707,7 +707,7 @@ def pert_scaled(jdata) :
707707
if jdata['init_fp_style'] == "ABACUS":
708708
fp_style = "abacus"
709709
poscar_name = "STRU"
710-
pert_cmd = 'python3 ' + pert_cmd + ' -etmax %f -ofmt %s %s %d %f > /dev/null' %(pert_box, fp_style, poscar_name, pert_numb, pert_atom)
710+
pert_cmd = sys.executable + ' ' + pert_cmd + ' -etmax %f -ofmt %s %s %d %f > /dev/null' %(pert_box, fp_style, poscar_name, pert_numb, pert_atom)
711711
for ii in sys_pe :
712712
for jj in scale :
713713
path_work = path_sp

dpgen/data/surf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env python3
22

33
import warnings
4-
import os,json,shutil,re,glob,argparse
4+
import os,json,shutil,re,glob,argparse,sys
55
import numpy as np
66
import subprocess as sp
77
import dpgen.data.tools.hcp as hcp
@@ -495,7 +495,7 @@ def pert_scaled(jdata) :
495495
sys_pe.sort()
496496
os.chdir(cwd)
497497

498-
pert_cmd = "python "+os.path.join(ROOT_PATH, 'data/tools/create_random_disturb.py')
498+
pert_cmd = sys.executable + ' ' + os.path.join(ROOT_PATH, 'data/tools/create_random_disturb.py')
499499
pert_cmd += ' -etmax %f -ofmt vasp POSCAR %d %f > /dev/null' %(pert_box, pert_numb, pert_atom)
500500
for ii in sys_pe :
501501
for jj in scale :

0 commit comments

Comments
 (0)