@@ -234,16 +234,13 @@ def treat_string(
234
234
quotes_length : Literal [1 , 3 ],
235
235
) -> str :
236
236
"""Split numpydoc sections, pass them for processing, then rejoin them."""
237
- # Split sections
238
237
lines = tokeninfo .string [quotes_length :- quotes_length ].split ("\n " )
239
- # handle the spaces before the closing quotes
238
+ # Handle the spaces before the closing quotes
240
239
last_line = lines [- 1 ]
241
240
if lines [- 1 ].isspace ():
242
241
lines [- 1 ] = ""
243
242
244
- # Everything before the first section header is in a single
245
- # summary/deprecation warning/extended summary section. This
246
- # section is called "Summary".
243
+ # Split sections
247
244
section_hyphen_lines = [
248
245
index
249
246
for index , line in enumerate (lines )
@@ -252,7 +249,6 @@ def treat_string(
252
249
section_starts = (
253
250
[0 ] + [index - 1 for index in section_hyphen_lines ] + [len (lines )]
254
251
)
255
-
256
252
sections = OrderedDict (
257
253
[
258
254
(
@@ -264,6 +260,7 @@ def treat_string(
264
260
)
265
261
]
266
262
)
263
+
267
264
if not section_hyphen_lines or section_hyphen_lines [0 ] > 1 :
268
265
# The "Summary" section here includes the numpydoc
269
266
# summary, deprecation warning, and extended summary
@@ -272,7 +269,6 @@ def treat_string(
272
269
_ , summary_section = sections .popitem (last = False )
273
270
sections ["Summary" ] = summary_section
274
271
sections .move_to_end ("Summary" , last = False )
275
- del lines , section_hyphen_lines
276
272
277
273
# Process sections
278
274
new_sections = self .treat_sections (sections )
0 commit comments