Skip to content

Commit

Permalink
Use pathlib.glob instead of glob.glob
Browse files Browse the repository at this point in the history
  • Loading branch information
sergio-costas committed Oct 18, 2023
1 parent f16c40f commit 586250e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions snapcraft/linters/library_linter.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,11 @@ def run(self) -> List[LinterIssue]:
return issues

def _find_deb_package(self, library_name: str) -> Optional[str]:
for path in glob.glob("/usr/lib/**", recursive=True):
if os.path.basename(path) == library_name:
for path in Path("/usr/lib").glob("**/*"):
if path.name == library_name:
try:
output = subprocess.run(
["dpkg", "-S", path], check=True, stdout=subprocess.PIPE
["dpkg", "-S", path.absolute().as_posix()], check=True, stdout=subprocess.PIPE
)
except subprocess.CalledProcessError:
# If the specified file doesn't belong to any package, the
Expand Down

0 comments on commit 586250e

Please sign in to comment.