File tree Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change 1313import sys
1414
1515
16+ def strip_blank_lines (l ):
17+ "Remove leading and trailing blank lines from a list of lines"
18+ while l and not l [0 ].strip ():
19+ del l [0 ]
20+ while l and not l [- 1 ].strip ():
21+ del l [- 1 ]
22+ return l
23+
24+
1625class Reader (object ):
1726 """A line-based string reader.
1827
@@ -214,6 +223,7 @@ def _parse_param_list(self, content):
214223
215224 desc = r .read_to_next_unindented_line ()
216225 desc = dedent_lines (desc )
226+ desc = strip_blank_lines (desc )
217227
218228 params .append ((arg_name , arg_type , desc ))
219229
Original file line number Diff line number Diff line change @@ -172,7 +172,7 @@ def test_parameters():
172172 arg , arg_type , desc = doc ['Parameters' ][1 ]
173173 assert_equal (arg_type , '(N, N) ndarray' )
174174 assert desc [0 ].startswith ('Covariance matrix' )
175- assert doc ['Parameters' ][0 ][- 1 ][- 2 ] == ' (1+2+3)/3'
175+ assert doc ['Parameters' ][0 ][- 1 ][- 1 ] == ' (1+2+3)/3'
176176
177177
178178def test_other_parameters ():
@@ -354,7 +354,6 @@ def test_str():
354354 .. math::
355355
356356 (1+2+3)/3
357-
358357cov : (N, N) ndarray
359358 Covariance matrix of the distribution.
360359shape : tuple of ints
@@ -948,6 +947,7 @@ def test_duplicate_signature():
948947 f : callable ``f(t, y, *f_args)``
949948 Aaa.
950949 jac : callable ``jac(t, y, *jac_args)``
950+
951951 Bbb.
952952
953953 Attributes
You can’t perform that action at this time.
0 commit comments