Skip to content

Commit 63ba4f8

Browse files
author
zhanglinyan
committed
fix: resolve numpydoc StopIteration error for async functions
1 parent 4dd6fd4 commit 63ba4f8

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

numpydoc/validate.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ def source_file_def_line(self):
328328
def_line = next(
329329
i
330330
for i, x in enumerate(
331-
re.match("^ *(def|class) ", s) for s in sourcelines[0]
331+
re.match(r"^\s*(async\s+)?(?:def|class)\s+", s) for s in sourcelines[0]
332332
)
333333
if x is not None
334334
)

0 commit comments

Comments
 (0)