Skip to content

Commit 1fa88dd

Browse files
committed
Fix small code nit
1 parent 8f05ba6 commit 1fa88dd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/matplotlib/sphinxext/plot_directive.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -838,11 +838,11 @@ def run(arguments, content, options, state_machine, state, lineno):
838838
else:
839839
source_file_name = rst_file
840840
code = textwrap.dedent("\n".join(map(str, content)))
841-
base, ext = os.path.splitext(os.path.basename(source_file_name))
842841
if options['output-base-name']:
843842
output_base = options['output-base-name']
844843
check_output_base_name(env, output_base)
845844
else:
845+
base, ext = os.path.splitext(os.path.basename(source_file_name))
846846
counter = document.attributes.get('_plot_counter', 0) + 1
847847
document.attributes['_plot_counter'] = counter
848848
output_base = '%s-%d.py' % (base, counter)

0 commit comments

Comments
 (0)