Skip to content

Commit 7fa050f

Browse files
wanghuancodereee4017
authored andcommitted
[Security] fix draw security problem (PaddlePaddle#61161)
* fix draw security problem
1 parent b89fd2d commit 7fa050f

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

python/paddle/base/framework.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5655,8 +5655,7 @@ def draw(self, save_path, name, marked_nodes=None, remove_ctr_var=True):
56555655
def _convert_to_pdf(dot_file_path):
56565656
pdf_save_path = os.path.splitext(dot_file_path)[0] + '.pdf'
56575657
exited_code = subprocess.call(
5658-
'dot -Tpdf ' + dot_file_path + ' -o ' + pdf_save_path,
5659-
shell=True,
5658+
['dot', '-Tpdf', dot_file_path, '-o', pdf_save_path]
56605659
)
56615660
if exited_code != 0:
56625661
print('The dot command is needed for creating pdf files.')

0 commit comments

Comments
 (0)