Skip to content

Commit 07871da

Browse files
committed
the extension should primarly resolve the srcdir.
This is required when building using python -m sphinx docs/source docs/build from the root of the project
1 parent 2a2a202 commit 07871da

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

sphinxarg/ext.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -468,6 +468,10 @@ def _nested_parse_paragraph(self, text):
468468
return content
469469

470470
def _open_filename(self):
471+
try:
472+
return open(os.path.join(self.env.srcdir, self.options['filename']))
473+
except OSError:
474+
pass
471475
# try open with given path
472476
try:
473477
return open(self.options['filename'])

0 commit comments

Comments
 (0)