diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2020-06-28 12:57:08 -0700 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2020-07-07 17:12:06 -0700 |
commit | e801e0435ea69b64443dd16ef5a13e93ea13546c (patch) | |
tree | 92460e2d336a5a394a62dd6b7255f82ab4412d62 /mesonbuild | |
parent | 7ab0090d2afd8e7301d1ee5d60dd63148ffff607 (diff) | |
download | meson-e801e0435ea69b64443dd16ef5a13e93ea13546c.zip meson-e801e0435ea69b64443dd16ef5a13e93ea13546c.tar.gz meson-e801e0435ea69b64443dd16ef5a13e93ea13546c.tar.bz2 |
symbolextractor: use try/finally in solaris_syms when wrapping gnu_syms
As suggested by dcbaker in
https://github.com/mesonbuild/meson/pull/7370#pullrequestreview-436872661
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Diffstat (limited to 'mesonbuild')
-rw-r--r-- | mesonbuild/scripts/symbolextractor.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/mesonbuild/scripts/symbolextractor.py b/mesonbuild/scripts/symbolextractor.py index 5240275..f4084be 100644 --- a/mesonbuild/scripts/symbolextractor.py +++ b/mesonbuild/scripts/symbolextractor.py @@ -124,9 +124,11 @@ def gnu_syms(libfilename: str, outfilename: str): def solaris_syms(libfilename: str, outfilename: str): # gnu_syms() works with GNU nm & readelf, not Solaris nm & elfdump origpath = os.environ['PATH'] - os.environ['PATH'] = '/usr/gnu/bin:' + origpath - gnu_syms(libfilename, outfilename) - os.environ['PATH'] = origpath + try: + os.environ['PATH'] = '/usr/gnu/bin:' + origpath + gnu_syms(libfilename, outfilename) + finally: + os.environ['PATH'] = origpath def osx_syms(libfilename: str, outfilename: str): # Get the name of the library |