diff --git a/PyTeX/build/paths/relative_path.py b/PyTeX/build/paths/relative_path.py index 14f7ba2..c582818 100644 --- a/PyTeX/build/paths/relative_path.py +++ b/PyTeX/build/paths/relative_path.py @@ -28,10 +28,6 @@ class RelativePath(Path): PyTeXRootDirType.DOC: GlobalPyTeXConfig.doc_root(), PyTeXRootDirType.TEX_SOURCE: GlobalPyTeXConfig.tex_root() }[self._pytex_root_dir_type] - try: - self._relative_path = self.relative_to(self._root_dir) - except ValueError as e: - raise NotImplementedError @property def root_dir_type(self) -> PyTeXRootDirType: @@ -43,7 +39,10 @@ class RelativePath(Path): @property def relative_path(self): - return self._relative_path + try: + return self.relative_to(self._root_dir) + except ValueError as e: + raise NotImplementedError class RelativeWindowsPath(RelativePath, WindowsPath):