Skip to content

Commit 71289ca

Browse files
committed
fix: use pathlib.Path
Close #2.
1 parent b435e69 commit 71289ca

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/sphinxnotes/recentupdate/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
from datetime import datetime
1515
from dataclasses import dataclass
1616
from os import path
17+
from pathlib import Path
1718

1819
from docutils import nodes
1920
from docutils.statemachine import StringList
@@ -115,7 +116,7 @@ def _get_docname(self, relfn_to_repo: str) -> str | None:
115116
relsrcdir_to_repo = path.relpath(self.env.srcdir, self.repo.working_dir)
116117
relfn_to_srcdir = path.relpath(relfn_to_repo, relsrcdir_to_repo)
117118
absfn = path.abspath(relfn_to_srcdir)
118-
if path.commonpath([self.env.srcdir, absfn]) != self.env.srcdir:
119+
if Path(path.commonpath([self.env.srcdir, absfn])) != self.env.srcdir:
119120
logger.debug(f'Skip {relfn_to_repo}: out of srcdir')
120121
return None
121122

0 commit comments

Comments
 (0)