Skip to content
This repository was archived by the owner on Feb 1, 2023. It is now read-only.

Commit 4b6ac0f

Browse files
committed
Use relative path for symlink
1 parent bb2ac9c commit 4b6ac0f

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/sage_docbuild/__init__.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -423,8 +423,11 @@ def pdf(self):
423423
html_output_dir = self._output_dir('html')
424424
pdf_doc_dir = os.path.join(SAGE_DOC, 'pdf')
425425

426+
# relative path is preferable for symlinks
427+
dst = os.path.join(html_output_dir, '..')
428+
relpath = os.path.relpath(pdf_doc_dir, dst)
426429
try:
427-
os.symlink(pdf_doc_dir, os.path.join(html_output_dir, '..', 'pdf'))
430+
os.symlink(relpath, os.path.join(dst, 'pdf'))
428431
except FileExistsError:
429432
pass
430433

0 commit comments

Comments
 (0)