Skip to content

Commit 9fe71a5

Browse files
committed
test: use subprocess.run() in test-security-check.py
1 parent 968aaae commit 9fe71a5

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

contrib/devtools/test-security-check.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,9 @@ def write_testcode(filename):
2020
''')
2121

2222
def call_security_check(cc, source, executable, options):
23-
subprocess.check_call([cc,source,'-o',executable] + options)
24-
p = subprocess.Popen(['./contrib/devtools/security-check.py',executable], stdout=subprocess.PIPE, stderr=subprocess.PIPE, stdin=subprocess.PIPE, universal_newlines=True)
25-
(stdout, stderr) = p.communicate()
26-
return (p.returncode, stdout.rstrip())
23+
subprocess.run([cc,source,'-o',executable] + options, check=True)
24+
p = subprocess.run(['./contrib/devtools/security-check.py',executable], stdout=subprocess.PIPE, universal_newlines=True)
25+
return (p.returncode, p.stdout.rstrip())
2726

2827
class TestSecurityChecks(unittest.TestCase):
2928
def test_ELF(self):

0 commit comments

Comments
 (0)