From f67e826d8a321340cbb88a0d3962c6bb8e61cb02 Mon Sep 17 00:00:00 2001 From: Jussi Pakkanen Date: Wed, 5 Jun 2013 01:02:13 +0300 Subject: [PATCH] Check return code. --- symbolextractor.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/symbolextractor.py b/symbolextractor.py index e7c6c4dc6..19b62593d 100755 --- a/symbolextractor.py +++ b/symbolextractor.py @@ -47,6 +47,8 @@ def linux_syms(libfilename, outfilename): pnm = subprocess.Popen(['nm', '--dynamic', '--extern-only', '--defined-only', '--format=posix', libfilename], stdout=subprocess.PIPE, stderr=subprocess.PIPE) output = pnm.communicate()[0].decode() + if pnm.returncode != 0: + raise RuntimeError('nm does not work.') result += [x.split()[0] for x in output.split('\n') if len(x) > 0] write_if_changed('\n'.join(result), outfilename)