From 6ec7be3f0b0fb655afa49b63fffd20f8273ba423 Mon Sep 17 00:00:00 2001 From: sxr <1173368667@qq.com> Date: Mon, 9 Sep 2024 16:06:11 +0800 Subject: [PATCH] Bug fix: fix #2, module "subprocess" doesn't has "STARTIPINFO" in Linux. --- VeribleFormatterVerilog.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/VeribleFormatterVerilog.py b/VeribleFormatterVerilog.py index 2e0bec3..2a1d014 100644 --- a/VeribleFormatterVerilog.py +++ b/VeribleFormatterVerilog.py @@ -85,9 +85,14 @@ def run(self, edit): if not encoding: encoding = "utf8" - # excute command - startupinfo = subprocess.STARTUPINFO() - startupinfo.dwFlags |= subprocess.STARTF_USESHOWWINDOW + # excute command + if hasattr(subprocess, "STARTUPINFO"): + # for windows + startupinfo = subprocess.STARTUPINFO() + startupinfo.dwFlags |= subprocess.STARTF_USESHOWWINDOW + else: + # for linux + startupinfo = None command_res = ' '.join(command) # print(command_res)