Skip to content

Commit 556faac

Browse files
committed
ENH: drop empty strings when listing RPATH entries for ELF binaries
This entries are not meaningful. This has the additional benefit of not returning an empty string RPATH entry for binaries with RPATH unset.
1 parent ee54561 commit 556faac

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mesonpy/_rpath.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ def fix_rpath(filepath: Path, libs_relative_path: str) -> None:
7474

7575
def _get_rpath(filepath: Path) -> List[str]:
7676
r = subprocess.run(['patchelf', '--print-rpath', os.fspath(filepath)], capture_output=True, text=True)
77-
return r.stdout.strip().split(':')
77+
return [x for x in r.stdout.strip().split(':') if x]
7878

7979
def _set_rpath(filepath: Path, rpath: Iterable[str]) -> None:
8080
subprocess.run(['patchelf','--set-rpath', ':'.join(rpath), os.fspath(filepath)], check=True)

0 commit comments

Comments
 (0)