Skip to content

Commit f4f886a

Browse files
committed
using pathlib instead in gitversion
1 parent 4c992f7 commit f4f886a

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

CPAC/info.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,10 @@
5252

5353
def get_cpac_gitversion() -> str | None:
5454
"""CPAC version as reported by the last commit in git."""
55-
from importlib.resources import as_file, files
55+
from pathlib import Path
5656
import subprocess
5757

58-
with as_file(files("CPAC")) as _cpac:
59-
gitpath = _cpac
58+
gitpath = Path(__file__).parent.resolve()
6059

6160
gitpathgit = gitpath / ".git"
6261
if not gitpathgit.exists():

0 commit comments

Comments
 (0)