1 parent dbb12cb commit ef33ff6Copy full SHA for ef33ff6
1 file changed
addons/cppcheckdata.py
@@ -1391,7 +1391,10 @@ def get_path_premium_addon():
1391
1392
1393
def cmd_output(cmd):
1394
- try:
1395
- return subprocess.check_output(cmd).strip().decode('ascii')
1396
- except subprocess.CalledProcessError as e:
1397
- return e.output
+ with subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE) as p:
+ comm = p.communicate()
+ out = comm[0]
+ if p.returncode == 1 and len(comm[1]) > 2:
1398
+ out = comm[1]
1399
+ return out.decode(encoding='utf-8', errors='ignore')
1400
+
0 commit comments