File tree Expand file tree Collapse file tree 1 file changed +5
-6
lines changed
Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -184,17 +184,16 @@ def audit_task(self, task):
184184 # input_file = None
185185
186186 if command is not None :
187- software = command .split ()[0 ]
188- software = software + " " + " --version"
187+ cmd_name = command .split ()[0 ]
188+ software = f" { cmd_name } --version"
189189 # take the first word of command as the name of the executable (this may not always be the case)
190- version_cmd = sp .run (software , shell = True , stdout = sp .PIPE ).stdout .decode (
191- "utf-8"
192- )
190+ version_cmd = sp .run (software , shell = True ,
191+ stdout = sp .PIPE ).stdout .decode ("utf-8" )
193192 try :
194193 version_cmd = version_cmd .splitlines ()[0 ]
195194
196195 except IndexError :
197- version_cmd = None
196+ version_cmd = f" { cmd_name } -- Version unknown"
198197
199198 else :
200199 version_cmd = None
You can’t perform that action at this time.
0 commit comments