Skip to content

Commit

Permalink
MAINT: remove unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
dnicolodi authored and rgommers committed Sep 1, 2023
1 parent f74e5a6 commit ac8256a
Showing 1 changed file with 1 addition and 14 deletions.
15 changes: 1 addition & 14 deletions mesonpy/_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@


if typing.TYPE_CHECKING: # pragma: no cover
from mesonpy._compat import Iterable, Iterator, Path
from mesonpy._compat import Iterator, Path


@contextlib.contextmanager
Expand All @@ -32,19 +32,6 @@ def chdir(path: Path) -> Iterator[Path]:
os.chdir(old_cwd)


@contextlib.contextmanager
def add_ld_path(paths: Iterable[str]) -> Iterator[None]:
"""Context manager helper to add a path to LD_LIBRARY_PATH."""
old_value = os.environ.get('LD_LIBRARY_PATH')
old_paths = old_value.split(os.pathsep) if old_value else []
os.environ['LD_LIBRARY_PATH'] = os.pathsep.join([*paths, *old_paths])
try:
yield
finally:
if old_value is not None: # pragma: no cover
os.environ['LD_LIBRARY_PATH'] = old_value


@contextlib.contextmanager
def create_targz(path: Path) -> Iterator[tarfile.TarFile]:
"""Opens a .tar.gz file in the file system for edition.."""
Expand Down

0 comments on commit ac8256a

Please sign in to comment.