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

Skip to content

Commit e13b0d3

Browse files
committed
Fix running unicode_demo.py from backend_driver.py. (The -*- coding
line must appear before any non-comment lines). svn path=/trunk/matplotlib/; revision=3544
1 parent 93a5049 commit e13b0d3

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

examples/backend_driver.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
'figtext.py',
3939
'fill_demo.py',
4040
'finance_demo.py',
41-
# 'fonts_demo_kw.py',
41+
'fonts_demo_kw.py',
4242
'histogram_demo.py',
4343
'image_demo.py',
4444
'image_demo2.py',
@@ -125,6 +125,13 @@ def drive(backend, python='python', switches = []):
125125
tmpfile_name = '_tmp_%s.py' % basename
126126
tmpfile = file(tmpfile_name, 'w')
127127

128+
for line in file(fname):
129+
line_lstrip = line.lstrip()
130+
if line_lstrip.startswith("#"):
131+
tmpfile.write(line)
132+
else:
133+
break
134+
128135
tmpfile.writelines((
129136
'from __future__ import division\n',
130137
'import matplotlib\n',

0 commit comments

Comments
 (0)