diff options
author | fanquake <fanquake@gmail.com> | 2020-05-15 10:52:20 +0800 |
---|---|---|
committer | fanquake <fanquake@gmail.com> | 2020-06-16 19:52:30 +0800 |
commit | 9fe71a57a6780569e618cf9a8d4f1acf6321017f (patch) | |
tree | 2a6de3b9ecde53efa32ba062db957a42690d2645 /contrib/devtools | |
parent | 968aaae940b064f21eddee6bb461aa08f777544c (diff) |
test: use subprocess.run() in test-security-check.py
Diffstat (limited to 'contrib/devtools')
-rwxr-xr-x | contrib/devtools/test-security-check.py | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/contrib/devtools/test-security-check.py b/contrib/devtools/test-security-check.py index 3bb9357657..629eba4f28 100755 --- a/contrib/devtools/test-security-check.py +++ b/contrib/devtools/test-security-check.py @@ -20,10 +20,9 @@ def write_testcode(filename): ''') def call_security_check(cc, source, executable, options): - subprocess.check_call([cc,source,'-o',executable] + options) - p = subprocess.Popen(['./contrib/devtools/security-check.py',executable], stdout=subprocess.PIPE, stderr=subprocess.PIPE, stdin=subprocess.PIPE, universal_newlines=True) - (stdout, stderr) = p.communicate() - return (p.returncode, stdout.rstrip()) + subprocess.run([cc,source,'-o',executable] + options, check=True) + p = subprocess.run(['./contrib/devtools/security-check.py',executable], stdout=subprocess.PIPE, universal_newlines=True) + return (p.returncode, p.stdout.rstrip()) class TestSecurityChecks(unittest.TestCase): def test_ELF(self): |