Skip to content

Commit

Permalink
Replace deprecated usage of pkg_resources with importlib.resources
Browse files Browse the repository at this point in the history
  • Loading branch information
calcmogul authored and renefritze committed Mar 18, 2024
1 parent 757a007 commit 25da6d4
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions clang_tidy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,16 @@
import sys
from pathlib import Path
import functools
import pkg_resources
from importlib.resources import files
import os


@functools.lru_cache(maxsize=None)
def _get_executable(name:str) -> Path:
possibles = [Path(pkg_resources.resource_filename('clang_tidy', f"data/bin/{name}{s}"))
for s in ("", ".exe", ".bin", ".dmg")]
possibles = [
Path(files("clang_tidy") / f"data/bin/{name}{s}")
for s in ("", ".exe", ".bin", ".dmg")
]
for exe in possibles:
if exe.exists():
if os.environ.get("CLANG_TIDY_WHEEL_VERBOSE", None):
Expand Down

0 comments on commit 25da6d4

Please sign in to comment.