Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 1b84dab

Browse files
committed
Merged revisions 7893 via svnmerge from
https://matplotlib.svn.sourceforge.net/svnroot/matplotlib/branches/v0_99_maint ........ r7893 | leejjoon | 2009-10-19 05:02:08 -0400 (Mon, 19 Oct 2009) | 1 line fix a bug in plot_directive ........ svn path=/trunk/matplotlib/; revision=7894
1 parent ae7cdae commit 1b84dab

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

lib/matplotlib/sphinxext/plot_directive.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,10 @@ def relpath(target, base=os.curdir):
113113
i+=1
114114

115115
rel_list = [os.pardir] * (len(base_list)-i) + target_list[i:]
116-
return os.path.join(*rel_list)
116+
if rel_list:
117+
return os.path.join(*rel_list)
118+
else:
119+
return ""
117120

118121
template = """
119122
.. htmlonly::
@@ -294,7 +297,7 @@ def _plot_directive(plot_path, basedir, function_name, plot_code, caption,
294297
outdir = os.path.join('plot_directive', basedir)
295298
reldir = relpath(setup.confdir, rstdir)
296299
linkdir = os.path.join(reldir, outdir)
297-
300+
298301
# tmpdir is where we build all the output files. This way the
299302
# plots won't have to be redone when generating latex after html.
300303

0 commit comments

Comments
 (0)