Skip to content

Commit 7c27ebb

Browse files
authored
Merge pull request #9 from pixelneo/async_func
support async
2 parents 0268ca5 + 6d088d1 commit 7c27ebb

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

python/pydocstring.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -242,9 +242,15 @@ def _controller_factory(self, env, templater, style):
242242
return MethodController(env, templater, style=style)
243243
elif first_word == 'class':
244244
return ClassController(env, templater, style=style)
245-
else:
246-
raise DocstringUnavailable(
247-
'Docstring cannot be created for selected object')
245+
elif first_word == 'async':
246+
second_word_catch = re.match('^\s*\w+\s+(\w+).*', line)
247+
if second_word_catch:
248+
second_word = second_word_catch.groups()[0]
249+
if second_word == 'def':
250+
return MethodController(env, templater, style=style)
251+
252+
raise DocstringUnavailable(
253+
'Docstring cannot be created for selected object')
248254

249255
def full_docstring(self):
250256
""" Writes docstring containing arguments, returns, raises, ... """

0 commit comments

Comments
 (0)